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

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

Issue 1726323002: Have Permission{Manager,Service} use Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Implementation of the PushMessagingPermissionContext that always allows usage 60 // Implementation of the PushMessagingPermissionContext that always allows usage
61 // of Push Messaging, regardless of the actual implementation. 61 // of Push Messaging, regardless of the actual implementation.
62 class FakePushMessagingPermissionContext 62 class FakePushMessagingPermissionContext
63 : public PushMessagingPermissionContext { 63 : public PushMessagingPermissionContext {
64 public: 64 public:
65 explicit FakePushMessagingPermissionContext(Profile* profile) 65 explicit FakePushMessagingPermissionContext(Profile* profile)
66 : PushMessagingPermissionContext(profile) {} 66 : PushMessagingPermissionContext(profile) {}
67 ~FakePushMessagingPermissionContext() override {} 67 ~FakePushMessagingPermissionContext() override {}
68 68
69 ContentSetting GetPermissionStatus( 69 ContentSetting GetPermissionStatus(
70 const GURL& requesting_origin, 70 const url::Origin& requesting_origin,
71 const GURL& embedding_origin) const override { 71 const url::Origin& embedding_origin) const override {
72 return CONTENT_SETTING_ALLOW; 72 return CONTENT_SETTING_ALLOW;
73 } 73 }
74 }; 74 };
75 75
76 scoped_ptr<KeyedService> BuildFakePushMessagingPermissionContext( 76 scoped_ptr<KeyedService> BuildFakePushMessagingPermissionContext(
77 content::BrowserContext* context) { 77 content::BrowserContext* context) {
78 return scoped_ptr<KeyedService>( 78 return scoped_ptr<KeyedService>(
79 new FakePushMessagingPermissionContext(static_cast<Profile*>(context))); 79 new FakePushMessagingPermissionContext(static_cast<Profile*>(context)));
80 } 80 }
81 81
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // (6) Verify that the message, as received by the Push Messaging Service, has 216 // (6) Verify that the message, as received by the Push Messaging Service, has
217 // indeed been decrypted by the GCM Driver, and has been forwarded to the 217 // indeed been decrypted by the GCM Driver, and has been forwarded to the
218 // Service Worker that has been associated with the subscription. 218 // Service Worker that has been associated with the subscription.
219 EXPECT_EQ(app_identifier.app_id(), app_id); 219 EXPECT_EQ(app_identifier.app_id(), app_id);
220 EXPECT_EQ(origin, dispatched_origin); 220 EXPECT_EQ(origin, dispatched_origin);
221 EXPECT_EQ(service_worker_registration_id, kTestServiceWorkerId); 221 EXPECT_EQ(service_worker_registration_id, kTestServiceWorkerId);
222 222
223 EXPECT_FALSE(payload.is_null); 223 EXPECT_FALSE(payload.is_null);
224 EXPECT_EQ(kTestPayload, payload.data); 224 EXPECT_EQ(kTestPayload, payload.data);
225 } 225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698