]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Make the will-navigate test run faster
authorCheng Zhao <zcbenz@gmail.com>
Fri, 18 Sep 2015 10:57:48 +0000 (18:57 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 18 Sep 2015 10:57:48 +0000 (18:57 +0800)
spec/api-browser-window-spec.coffee
spec/fixtures/pages/will-navigate.html

index 846b8bdbc9f0a3f1d212183ec52ec4f84d70159b..bb4d782e7ffba1d23cd72ab2968860fec90efd33 100644 (file)
@@ -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) ->
index bd2ebdc1cb43c90dfb83bb78fef6b1058ac9d25e..8d0c9b779e2dcd811c2b83aefdf9bf76f2805fdd 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <body>
 <script type="text/javascript" charset="utf-8">
-  location = 'https://www.github.com'
+  location.reload();
 </script>
 </body>
 </html>