From: Cheng Zhao Date: Fri, 18 Sep 2015 10:57:48 +0000 (+0800) Subject: spec: Make the will-navigate test run faster X-Git-Tag: v0.33.1~11^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f716d47e546034d6adaf910fd62b0a6dd203caf7;p=electron.git spec: Make the will-navigate test run faster --- diff --git a/spec/api-browser-window-spec.coffee b/spec/api-browser-window-spec.coffee index 846b8bdb..bb4d782e 100644 --- a/spec/api-browser-window-spec.coffee +++ b/spec/api-browser-window-spec.coffee @@ -295,14 +295,14 @@ describe 'browser-window module', -> w.minimize() describe 'will-navigate event', -> - return if isCI and process.platform is 'darwin' + @timeout 10000 it 'emits when user starts a navigation', (done) -> - @timeout 10000 - w.webContents.on 'will-navigate', (event, url) -> + url = "file://#{fixtures}/pages/will-navigate.html" + w.webContents.on 'will-navigate', (event, u) -> event.preventDefault() - assert.equal url, 'https://www.github.com/' + assert.equal u, url done() - w.loadUrl "file://#{fixtures}/pages/will-navigate.html" + w.loadUrl url describe 'beginFrameSubscription method', -> it 'subscribes frame updates', (done) -> diff --git a/spec/fixtures/pages/will-navigate.html b/spec/fixtures/pages/will-navigate.html index bd2ebdc1..8d0c9b77 100644 --- a/spec/fixtures/pages/will-navigate.html +++ b/spec/fixtures/pages/will-navigate.html @@ -1,7 +1,7 @@