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

Side by Side Diff: chrome/browser/push_messaging/push_messaging_service_unittest.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/browser/push_messaging_service.h" 5 #include "content/public/browser/push_messaging_service.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 EXPECT_EQ(kTestEncodedP256Key, push_service->NormalizeSenderInfo(p256dh)); 236 EXPECT_EQ(kTestEncodedP256Key, push_service->NormalizeSenderInfo(p256dh));
237 237
238 // Any other value, binary or not, will be passed through as-is. 238 // Any other value, binary or not, will be passed through as-is.
239 EXPECT_EQ("1234567890", push_service->NormalizeSenderInfo("1234567890")); 239 EXPECT_EQ("1234567890", push_service->NormalizeSenderInfo("1234567890"));
240 EXPECT_EQ("foo@bar.com", push_service->NormalizeSenderInfo("foo@bar.com")); 240 EXPECT_EQ("foo@bar.com", push_service->NormalizeSenderInfo("foo@bar.com"));
241 241
242 p256dh[0] = 0x05; // invalidate |p256dh| as a public key. 242 p256dh[0] = 0x05; // invalidate |p256dh| as a public key.
243 243
244 EXPECT_EQ(p256dh, push_service->NormalizeSenderInfo(p256dh)); 244 EXPECT_EQ(p256dh, push_service->NormalizeSenderInfo(p256dh));
245 } 245 }
246
247 TEST_F(PushMessagingServiceTest, DifferentEndpoints) {
248 PushMessagingServiceImpl* push_service = profile()->GetPushMessagingService();
249 ASSERT_TRUE(push_service);
250
251 // Verifies that the service returns different endpoints depending on whether
252 // support for the standard protocol is requested.
253 EXPECT_NE(push_service->GetEndpoint(true), push_service->GetEndpoint(false));
254 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698