OLD | NEW |
---|---|
1 var jsTestIsAsync = true; | 1 var jsTestIsAsync = true; |
2 if (self.importScripts && !self.postMessage) { | 2 if (self.importScripts && !self.postMessage) { |
3 // Shared worker. Make postMessage send to the newest client, which in | 3 // Shared worker. Make postMessage send to the newest client, which in |
4 // our tests is the only client. | 4 // our tests is the only client. |
5 | 5 |
6 // Store messages for sending until we have somewhere to send them. | 6 // Store messages for sending until we have somewhere to send them. |
7 self.postMessage = function(message) | 7 self.postMessage = function(message) |
8 { | 8 { |
9 if (typeof self.pendingMessages === "undefined") | 9 if (typeof self.pendingMessages === "undefined") |
10 self.pendingMessages = []; | 10 self.pendingMessages = []; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 testFailed("No exception thrown! Should have been " + exceptionCode); | 90 testFailed("No exception thrown! Should have been " + exceptionCode); |
91 } catch (e) { | 91 } catch (e) { |
92 code = e.code; | 92 code = e.code; |
93 if (!_quiet) | 93 if (!_quiet) |
94 testPassed("Exception was thrown."); | 94 testPassed("Exception was thrown."); |
95 shouldBe("code", exceptionCode, _quiet); | 95 shouldBe("code", exceptionCode, _quiet); |
96 if (exceptionName) { | 96 if (exceptionName) { |
97 ename = e.name; | 97 ename = e.name; |
98 shouldBe("ename", exceptionName, _quiet); | 98 shouldBe("ename", exceptionName, _quiet); |
99 } | 99 } |
100 if (!_quiet) | |
101 debug("Exception message: " + e.message); | |
jsbell
2013/07/12 18:45:31
This is the test helper change.
| |
100 } | 102 } |
101 } | 103 } |
102 | 104 |
103 function evalAndExpectExceptionClass(cmd, expected) | 105 function evalAndExpectExceptionClass(cmd, expected) |
104 { | 106 { |
105 debug("Expecting " + expected + " exception from " + cmd); | 107 debug("Expecting " + expected + " exception from " + cmd); |
106 try { | 108 try { |
107 eval(cmd); | 109 eval(cmd); |
108 testFailed("No exception thrown!" ); | 110 testFailed("No exception thrown!" ); |
109 } catch (e) { | 111 } catch (e) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 | 217 |
216 requests.forEach(function(req) { | 218 requests.forEach(function(req) { |
217 req.onsuccess = function() { | 219 req.onsuccess = function() { |
218 --count; | 220 --count; |
219 if (!count) | 221 if (!count) |
220 callback(requests); | 222 callback(requests); |
221 }; | 223 }; |
222 req.onerror = unexpectedErrorCallback; | 224 req.onerror = unexpectedErrorCallback; |
223 }); | 225 }); |
224 } | 226 } |
OLD | NEW |