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

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

Issue 1931843002: Ship Web Push subscription restrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_constants.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 b267e03216b9f58fc3dbbfa23cdbb3ac9fadc4e3..46dde0f20c07f570bf1d33b6b84f03f82c02c52d 100644
--- a/chrome/browser/push_messaging/push_messaging_browsertest.cc
+++ b/chrome/browser/push_messaging/push_messaging_browsertest.cc
@@ -218,8 +218,10 @@ class PushMessagingBrowserTest : public InProcessBrowserTest {
const std::string& expected_push_subscription_info,
bool use_key = true);
- std::string GetEndpointForSubscriptionId(const std::string& subscription_id) {
- return std::string(kPushMessagingEndpoint) + "/" + subscription_id;
+ std::string GetEndpointForSubscriptionId(const std::string& subscription_id,
+ bool standard_protocol = true) {
+ return push_service()->GetEndpoint(standard_protocol).spec() +
+ subscription_id;
}
PushMessagingAppIdentifier GetAppIdentifierForServiceWorkerRegistration(
@@ -324,8 +326,9 @@ void PushMessagingBrowserTest::TryToSubscribeSuccessfully(
EXPECT_TRUE(RunScript("documentSubscribePushWithoutKey()", &script_result));
}
- EXPECT_EQ(GetEndpointForSubscriptionId(expected_push_subscription_info),
- script_result);
+ EXPECT_EQ(
+ GetEndpointForSubscriptionId(expected_push_subscription_info, use_key),
+ script_result);
}
PushMessagingAppIdentifier
@@ -525,7 +528,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeWorkerUsingManifest) {
// the code to read sender id from the manifest and will write it to the
// datastore.
ASSERT_TRUE(RunScript("documentSubscribePushWithoutKey()", &script_result));
- EXPECT_EQ(GetEndpointForSubscriptionId("1-0"), script_result);
+ EXPECT_EQ(GetEndpointForSubscriptionId("1-0", false), script_result);
ASSERT_TRUE(RunScript("unsubscribePush()", &script_result));
EXPECT_EQ("unsubscribe result: true", script_result);
@@ -534,7 +537,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeWorkerUsingManifest) {
// Now run the subscribe from the service worker without a key.
// In this case, the sender id will be read from the datastore.
ASSERT_TRUE(RunScript("workerSubscribePushNoKey()", &script_result));
- EXPECT_EQ(GetEndpointForSubscriptionId("1-1"), script_result);
+ EXPECT_EQ(GetEndpointForSubscriptionId("1-1", false), script_result);
ASSERT_TRUE(RunScript("unsubscribePush()", &script_result));
EXPECT_EQ("unsubscribe result: true", script_result);
« no previous file with comments | « no previous file | chrome/browser/push_messaging/push_messaging_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698