OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <script> | 4 <script> |
5 function getPropertyDescriptor(name) { | 5 function getPropertyDescriptor(name) { |
6 return ( | 6 return ( |
7 Object.getOwnPropertyDescriptor(ServiceWorkerContainer.prototype, name) || | 7 Object.getOwnPropertyDescriptor(ServiceWorkerContainer.prototype, name) || |
8 // FIXME: Remove this when http://crbug.com/43394 is fixed. | 8 // FIXME: Remove this when http://crbug.com/43394 is fixed. |
9 Object.getOwnPropertyDescriptor(navigator.serviceWorker, name)); | 9 Object.getOwnPropertyDescriptor(navigator.serviceWorker, name)); |
10 } | 10 } |
11 | 11 |
12 test(function() { | 12 test(function() { |
13 assert_true('ServiceWorkerContainer' in window, | 13 assert_true('ServiceWorkerContainer' in window, |
14 'the constructor should be defined'); | 14 'the constructor should be defined'); |
15 assert_throws(null, function() { new ServiceWorkerContainer(); }, | 15 assert_throws(null, function() { new ServiceWorkerContainer(); }, |
16 'the constructor should not be callable with "new"'); | 16 'the constructor should not be callable with "new"'); |
17 assert_throws(null, function() { ServiceWorkerContainer(); }, | 17 assert_throws(null, function() { ServiceWorkerContainer(); }, |
18 'the constructor should not be callable'); | 18 'the constructor should not be callable'); |
19 | 19 |
20 var descriptor = getPropertyDescriptor('waiting'); | 20 ['active', 'waiting', 'installing', 'controller'].forEach(function(property) { |
21 assert_false(descriptor.configurable, | 21 var descriptor = getPropertyDescriptor(property); |
22 'the waiting property should be Unforgeable'); | 22 assert_false(descriptor.configurable, |
| 23 'the ' + property + ' property should be Unforgeable'); |
| 24 }); |
23 }, 'ServiceWorkerContainer interface'); | 25 }, 'ServiceWorkerContainer interface'); |
24 </script> | 26 </script> |
OLD | NEW |