]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Node integration should work after POST
authorCheng Zhao <zcbenz@gmail.com>
Tue, 1 Sep 2015 03:51:28 +0000 (11:51 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 1 Sep 2015 03:51:28 +0000 (11:51 +0800)
spec/fixtures/pages/post.html [new file with mode: 0644]
spec/webview-spec.coffee

diff --git a/spec/fixtures/pages/post.html b/spec/fixtures/pages/post.html
new file mode 100644 (file)
index 0000000..06f6f36
--- /dev/null
@@ -0,0 +1,10 @@
+<html>
+<body>
+  <form id="form" action="d.html" method="post" accept-charset="utf-8">
+  <p><input type="submit" value="submit"></p>
+  </form>
+  <script type="text/javascript" charset="utf-8">
+    document.getElementById("form").submit();
+  </script>
+</body>
+</html>
index 7c2cd1a92adc05601b5d63c5838d07d13c96e69e..6eb391ac94832f78b7e208b25bb3d3c68f3f6715 100644 (file)
@@ -48,6 +48,14 @@ describe '<webview> tag', ->
       webview.src = "file://#{fixtures}/pages/d.html"
       document.body.appendChild webview
 
+    it 'loads node symbols after POST navigation when set', (done) ->
+      webview.addEventListener 'console-message', (e) ->
+        assert.equal e.message, 'function object object'
+        done()
+      webview.setAttribute 'nodeintegration', 'on'
+      webview.src = "file://#{fixtures}/pages/post.html"
+      document.body.appendChild webview
+
     # If the test is executed with the debug build on Windows, we will skip it
     # because native modules don't work with the debug build (see issue #2558).
     if process.platform isnt 'win32' or