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

Unified Diff: chrome/browser/push_messaging/push_messaging_browsertest.cc

Issue 1231613005: Hook up the Push API with GCM's new ability to own encryption keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-encryption
Patch Set: Created 5 years, 5 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 | chrome/browser/push_messaging/push_messaging_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/push_messaging/push_messaging_browsertest.cc
diff --git a/chrome/browser/push_messaging/push_messaging_browsertest.cc b/chrome/browser/push_messaging/push_messaging_browsertest.cc
index 4deed1630b9dac918f8007192978b864368b09b3..2c543879e0ea3d215150359f744eabaa8100b0d1 100644
--- a/chrome/browser/push_messaging/push_messaging_browsertest.cc
+++ b/chrome/browser/push_messaging/push_messaging_browsertest.cc
@@ -1094,6 +1094,27 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
EXPECT_TRUE(stored_app_identifier2.is_null());
}
+IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, EncryptionKeyUniqueness) {
+ TryToSubscribeSuccessfully("1-0" /* expected_push_subscription_id */);
+
+ std::string first_public_key;
+ ASSERT_TRUE(RunScript("getCurve25519dh()", &first_public_key));
+ EXPECT_GE(first_public_key.size(), 32u);
+
+ std::string script_result;
+ gcm_service()->AddExpectedUnregisterResponse(gcm::GCMClient::SUCCESS);
+ ASSERT_TRUE(RunScript("unsubscribePush()", &script_result));
+ EXPECT_EQ("unsubscribe result: true", script_result);
+
+ TryToSubscribeSuccessfully("1-1" /* expected_push_subscription_id */);
+
+ std::string second_public_key;
+ ASSERT_TRUE(RunScript("getCurve25519dh()", &second_public_key));
+ EXPECT_GE(second_public_key.size(), 32u);
+
+ EXPECT_NE(first_public_key, second_public_key);
+}
+
class PushMessagingIncognitoBrowserTest : public PushMessagingBrowserTest {
public:
~PushMessagingIncognitoBrowserTest() override {}
« no previous file with comments | « no previous file | chrome/browser/push_messaging/push_messaging_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698