OLD | NEW |
| 1 if (self.importScripts) { |
| 2 importScripts('../../../resources/js-test.js'); |
| 3 importScripts('notification-worker.js'); |
| 4 } |
| 5 |
1 function runTest() | 6 function runTest() |
2 { | 7 { |
3 var notification = new Notification("Notification"); | 8 var notification = new Notification("Notification"); |
4 notification.addEventListener("show", function() { | 9 notification.addEventListener("show", function() { |
5 testPassed("notification.onshow() has been called."); | 10 testPassed("notification.onshow() has been called."); |
6 if (window.testRunner) | 11 if (testRunner) |
7 testRunner.simulateWebNotificationClick("Notification"); | 12 testRunner.simulateWebNotificationClick("Notification"); |
8 }); | 13 }); |
9 | 14 |
10 notification.addEventListener("click", function() { | 15 notification.addEventListener("click", function() { |
11 testPassed("notification.onclick() has been called."); | 16 testPassed("notification.onclick() has been called."); |
12 notification.close(); | 17 finishJSTest(); |
13 | |
14 if (window.testRunner) | |
15 testRunner.notifyDone(); | |
16 }); | 18 }); |
17 } | 19 } |
OLD | NEW |