Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: LayoutTests/http/tests/push_messaging/subscribe-encryption-public-key.html

Issue 1309723004: Change PushSubscription.curve25519dh to PushSubscription.getKey() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/push_messaging/subscribe-encryption-public-key.html
diff --git a/LayoutTests/http/tests/push_messaging/subscribe-encryption-public-key.html b/LayoutTests/http/tests/push_messaging/subscribe-encryption-public-key.html
index 54dcce0a19c743f6903f4da723d936233acab21a..08d60988f2dc0ce4a87b321fddc3a099efe6ab3b 100644
--- a/LayoutTests/http/tests/push_messaging/subscribe-encryption-public-key.html
+++ b/LayoutTests/http/tests/push_messaging/subscribe-encryption-public-key.html
@@ -38,17 +38,25 @@
return swRegistration.pushManager.subscribe();
})
.then(function(pushSubscription) {
+ // TODO(peter): Remove support for the attribute when the embedder has been updated.
assert_idl_attribute(pushSubscription, 'curve25519dh');
- assert_equals(pushSubscription.curve25519dh, pushSubscription.curve25519dh);
- assert_readonly(pushSubscription, 'curve25519dh');
- assert_equals(pushSubscription.curve25519dh.byteLength, EXPECTED_KEY_LENGTH);
- encryptionKey = SerializeArrayBuffer(pushSubscription.curve25519dh);
+ assert_own_property(PushSubscription.prototype, 'getKey');
+ assert_not_equals(pushSubscription.getKey('curve25519dh'), null);
+ assert_equals(pushSubscription.getKey('curve25519dh').byteLength, EXPECTED_KEY_LENGTH);
+
+ // The returned ArrayBuffers are expected to be the same.
+ assert_equals(pushSubscription.getKey('curve25519dh'), pushSubscription.getKey('curve25519dh'));
+
+ // Getting a key with an unsupported algorithm should throw an exception.
+ assert_throws(TypeError(), () => pushSubscription.getKey('petercurve9001'));
+
+ encryptionKey = SerializeArrayBuffer(pushSubscription.getKey('curve25519dh'));
return swRegistration.pushManager.getSubscription();
})
.then(function(pushSubscription) {
- assert_equals(SerializeArrayBuffer(pushSubscription.curve25519dh), encryptionKey);
+ assert_equals(SerializeArrayBuffer(pushSubscription.getKey('curve25519dh')), encryptionKey);
return service_worker_unregister_and_done(test, workerScope);
})
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698