]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Test loading script tag in html
authorCheng Zhao <zcbenz@gmail.com>
Sat, 31 Jan 2015 01:56:31 +0000 (17:56 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 31 Jan 2015 01:59:00 +0000 (17:59 -0800)
spec/asar-spec.coffee
spec/fixtures/asar/script.asar [new file with mode: 0755]

index 547b7474a82baf5c95cb979ce52d8db3e5a0fbe2..21203c0d4e10b49cfbd99fc07af2266ee649334f 100644 (file)
@@ -392,6 +392,19 @@ describe 'asar package', ->
         assert.equal dirname, path.dirname(p)
         done()
 
+    it 'loads script tag in html', (done) ->
+      after ->
+        w.destroy()
+        ipc.removeAllListeners 'ping'
+
+      w = new BrowserWindow(show: false, width: 400, height: 400)
+      p = path.resolve fixtures, 'asar', 'script.asar', 'index.html'
+      u = url.format protocol: 'file', slashed: true, pathname: p
+      w.loadUrl u
+      ipc.once 'ping', (event, message) ->
+        assert.equal message, 'pong'
+        done()
+
   describe 'original-fs module', ->
     originalFs = require 'original-fs'
 
diff --git a/spec/fixtures/asar/script.asar b/spec/fixtures/asar/script.asar
new file mode 100755 (executable)
index 0000000..152045a
Binary files /dev/null and b/spec/fixtures/asar/script.asar differ