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

Side by Side Diff: chrome/browser/push_messaging/push_messaging_service_unittest.cc

Issue 1876473002: Add a feature flag for enabling subscription restrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 EXPECT_EQ(kTestEncodedP256Key, push_service->NormalizeSenderInfo(p256dh)); 253 EXPECT_EQ(kTestEncodedP256Key, push_service->NormalizeSenderInfo(p256dh));
254 254
255 // Any other value, binary or not, will be passed through as-is. 255 // Any other value, binary or not, will be passed through as-is.
256 EXPECT_EQ("1234567890", push_service->NormalizeSenderInfo("1234567890")); 256 EXPECT_EQ("1234567890", push_service->NormalizeSenderInfo("1234567890"));
257 EXPECT_EQ("foo@bar.com", push_service->NormalizeSenderInfo("foo@bar.com")); 257 EXPECT_EQ("foo@bar.com", push_service->NormalizeSenderInfo("foo@bar.com"));
258 258
259 p256dh[0] = 0x05; // invalidate |p256dh| as a public key. 259 p256dh[0] = 0x05; // invalidate |p256dh| as a public key.
260 260
261 EXPECT_EQ(p256dh, push_service->NormalizeSenderInfo(p256dh)); 261 EXPECT_EQ(p256dh, push_service->NormalizeSenderInfo(p256dh));
262 } 262 }
263
264 TEST_F(PushMessagingServiceTest, DifferentEndpoints) {
265 PushMessagingServiceImpl* push_service = profile()->GetPushMessagingService();
266 ASSERT_TRUE(push_service);
267
268 // Verifies that the service returns different endpoints depending on whether
269 // support for the standard protocol is requested.
270 EXPECT_NE(push_service->GetEndpoint(true), push_service->GetEndpoint(false));
271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698