LEFT | RIGHT |
1 (function() | 1 (function() |
2 { | 2 { |
3 let tabs = SDK.require("sdk/tabs"); | 3 let tabs = SDK.require("sdk/tabs"); |
4 let server = null; | 4 let server = null; |
5 let tab = null; | 5 let tab = null; |
6 | 6 |
7 module("Pop-up blocker", { | 7 module("Pop-up blocker", { |
8 beforeEach: function() | 8 beforeEach: function() |
9 { | 9 { |
10 prepareFilterComponents.call(this, true); | 10 prepareFilterComponents.call(this, true); |
(...skipping 27 matching lines...) Expand all Loading... |
38 { | 38 { |
39 response.setHeader("Content-Type", "text/html; charset=utf-8"); | 39 response.setHeader("Content-Type", "text/html; charset=utf-8"); |
40 | 40 |
41 let body = '<html><body>OK</body></html>'; | 41 let body = '<html><body>OK</body></html>'; |
42 response.bodyOutputStream.write(body, body.length); | 42 response.bodyOutputStream.write(body, body.length); |
43 }); | 43 }); |
44 | 44 |
45 tabs.open({ | 45 tabs.open({ |
46 url: "http://127.0.0.1:1234/test", | 46 url: "http://127.0.0.1:1234/test", |
47 inBackground: false, | 47 inBackground: false, |
48 onReady: start | 48 onReady: function(aTab) |
| 49 { |
| 50 tab = aTab; |
| 51 start(); |
| 52 } |
49 }); | 53 }); |
50 | 54 |
51 stop(); | 55 stop(); |
52 }, | 56 }, |
53 afterEach: function() | 57 afterEach: function() |
54 { | 58 { |
55 restoreFilterComponents.call(this); | 59 restoreFilterComponents.call(this); |
56 restorePrefs.call(this); | 60 restorePrefs.call(this); |
57 | 61 |
58 stop(); | 62 stop(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 contentScript: "(" + function() | 134 contentScript: "(" + function() |
131 { | 135 { |
132 document.getElementById('link').click(); | 136 document.getElementById('link').click(); |
133 } + ")()" | 137 } + ")()" |
134 }); | 138 }); |
135 } | 139 } |
136 | 140 |
137 for (let [filter, result] of tests) | 141 for (let [filter, result] of tests) |
138 asyncTest(filter, runTest.bind(null, Filter.fromText(filter), result)); | 142 asyncTest(filter, runTest.bind(null, Filter.fromText(filter), result)); |
139 })(); | 143 })(); |
LEFT | RIGHT |