Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Push API: Verifies the supported content encodings in PushManager.</t itle> | 4 <title>Push API: Verifies the supported content encodings in PushManager.</t itle> |
| 5 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
| 6 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
| 7 <script src="../serviceworker/resources/test-helpers.js"></script> | 7 <script src="../serviceworker/resources/test-helpers.js"></script> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <script> | 10 <script> |
| 11 // Tests that the expected Content-Encoding values are indicated by the | 11 // Tests that the expected Content-Encoding values are indicated by the |
| 12 // PushManager.supportedContentEncodings property. | 12 // PushManager.supportedContentEncodings property. |
| 13 test(function() { | 13 test(function() { |
| 14 assert_own_property(window, 'PushManager', 'PushManager needs to be expo sed as a global.'); | 14 assert_own_property(window, 'PushManager', 'PushManager needs to be expo sed as a global.'); |
| 15 assert_own_property(PushManager, 'supportedContentEncodings'); | 15 assert_own_property(PushManager, 'supportedContentEncodings'); |
| 16 | 16 |
| 17 assert_equals(PushManager.supportedContentEncodings, PushManager.support edContentEncodings); | 17 assert_equals(PushManager.supportedContentEncodings, PushManager.support edContentEncodings); |
| 18 assert_true(Array.isArray(PushManager.supportedContentEncodings)); | 18 assert_true(Array.isArray(PushManager.supportedContentEncodings)); |
| 19 | 19 |
| 20 // TODO(crbug.com/679789): The `aes128gcm` Content-Encoding must be supp orted as well. | 20 assert_equals(PushManager.supportedContentEncodings.length, 2); |
| 21 assert_equals(PushManager.supportedContentEncodings.length, 1); | 21 assert_equals(PushManager.supportedContentEncodings[0], 'aes128gcm'); |
|
johnme
2017/05/23 17:37:48
Nit: do we care about the order? If not, could use
| |
| 22 assert_equals(PushManager.supportedContentEncodings[0], 'aesgcm'); | 22 assert_equals(PushManager.supportedContentEncodings[1], 'aesgcm'); |
| 23 }); | 23 }); |
| 24 </script> | 24 </script> |
| 25 </body> | 25 </body> |
| 26 </html> | 26 </html> |
| OLD | NEW |