|
45 | 45 | //return new Error("Generic error"); |
46 | 46 | return new Error(); |
47 | 47 | }, |
48 | | - prepareFakeOperaEnvironment: function() { |
49 | | - if (typeof window !== 'undefined' && !window.opera) { |
50 | | - window.opera = "fake"; |
51 | | - window.fakeOpera = true; |
52 | | - } |
53 | | - }, |
54 | | - clearFakeOperaEnvironment: function() { |
55 | | - if (typeof window !== 'undefined' && window.fakeOpera) { |
56 | | - delete window.opera; |
57 | | - delete window.fakeOpera; |
58 | | - } |
59 | | - }, |
60 | 48 | createModeStub: function(mode) { |
61 | 49 | return function() { |
62 | 50 | ok(false, 'must not call run() for mode "' + mode + '"'); |
|
159 | 147 | p.opera9 = function() { |
160 | 148 | ok(true, 'called run() for "opera9"'); |
161 | 149 | }; |
162 | | - UnitTest.fn.prepareFakeOperaEnvironment(); |
163 | 150 | p.run(CapturedExceptions.opera_854); |
164 | 151 | p.run(CapturedExceptions.opera_902); |
165 | 152 | p.run(CapturedExceptions.opera_927); |
166 | 153 | p.run(CapturedExceptions.opera_964); |
167 | | - UnitTest.fn.clearFakeOperaEnvironment(); |
168 | 154 | }); |
169 | 155 |
|
170 | 156 | test("run opera10a", function() { |
|
174 | 160 | p.opera10a = function() { |
175 | 161 | ok(true, 'called run() for "opera10a"'); |
176 | 162 | }; |
177 | | - UnitTest.fn.prepareFakeOperaEnvironment(); |
178 | 163 | p.run(CapturedExceptions.opera_1010); |
179 | | - UnitTest.fn.clearFakeOperaEnvironment(); |
180 | 164 | }); |
181 | 165 |
|
182 | 166 | test("run opera10b", function() { |
|
186 | 170 | p.opera10b = function() { |
187 | 171 | ok(true, 'called run() for "opera10b"'); |
188 | 172 | }; |
189 | | - UnitTest.fn.prepareFakeOperaEnvironment(); |
190 | 173 | p.run(CapturedExceptions.opera_1063); |
191 | | - UnitTest.fn.clearFakeOperaEnvironment(); |
192 | 174 | }); |
193 | 175 |
|
194 | 176 | test("run opera11", function() { |
|
198 | 180 | p.opera11 = function() { |
199 | 181 | ok(true, 'called run() for "opera11"'); |
200 | 182 | }; |
201 | | - UnitTest.fn.prepareFakeOperaEnvironment(); |
202 | 183 | p.run(CapturedExceptions.opera_1111); |
203 | 184 | p.run(CapturedExceptions.opera_1151); |
204 | 185 | p.run(CapturedExceptions.opera_1216); |
205 | | - UnitTest.fn.clearFakeOperaEnvironment(); |
206 | 186 | }); |
207 | 187 |
|
208 | 188 | test("run other", function() { |
|
0 commit comments