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

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

Issue 1154943008: Update push messaging tests to use both infobars and bubbles (w/ autoresponse) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put the auto-responder directly into the PermissionBubbleManager Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/barrier_closure.h" 8 #include "base/barrier_closure.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/browser/browsing_data/browsing_data_helper.h" 14 #include "chrome/browser/browsing_data/browsing_data_helper.h"
15 #include "chrome/browser/browsing_data/browsing_data_remover.h" 15 #include "chrome/browser/browsing_data/browsing_data_remover.h"
16 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" 16 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h"
17 #include "chrome/browser/infobars/infobar_responder.h"
18 #include "chrome/browser/infobars/infobar_service.h"
19 #include "chrome/browser/notifications/notification_test_util.h" 17 #include "chrome/browser/notifications/notification_test_util.h"
20 #include "chrome/browser/notifications/platform_notification_service_impl.h" 18 #include "chrome/browser/notifications/platform_notification_service_impl.h"
21 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/push_messaging/push_messaging_app_identifier.h" 20 #include "chrome/browser/push_messaging/push_messaging_app_identifier.h"
23 #include "chrome/browser/push_messaging/push_messaging_constants.h" 21 #include "chrome/browser/push_messaging/push_messaging_constants.h"
24 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" 22 #include "chrome/browser/push_messaging/push_messaging_service_factory.h"
25 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" 23 #include "chrome/browser/push_messaging/push_messaging_service_impl.h"
26 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" 24 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h"
27 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" 25 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
28 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
29 #include "chrome/browser/ui/tabs/tab_strip_model.h" 27 #include "chrome/browser/ui/tabs/tab_strip_model.h"
28 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
29 #include "chrome/common/chrome_switches.h"
30 #include "chrome/test/base/in_process_browser_test.h" 30 #include "chrome/test/base/in_process_browser_test.h"
31 #include "chrome/test/base/ui_test_utils.h" 31 #include "chrome/test/base/ui_test_utils.h"
32 #include "components/content_settings/core/browser/host_content_settings_map.h" 32 #include "components/content_settings/core/browser/host_content_settings_map.h"
33 #include "components/content_settings/core/common/content_settings.h" 33 #include "components/content_settings/core/common/content_settings.h"
34 #include "components/content_settings/core/common/content_settings_types.h" 34 #include "components/content_settings/core/common/content_settings_types.h"
35 #include "components/gcm_driver/gcm_client.h" 35 #include "components/gcm_driver/gcm_client.h"
36 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
37 #include "content/public/common/content_switches.h" 37 #include "content/public/common/content_switches.h"
38 #include "content/public/test/browser_test_utils.h" 38 #include "content/public/test/browser_test_utils.h"
39 #include "content/public/test/test_utils.h" 39 #include "content/public/test/test_utils.h"
(...skipping 30 matching lines...) Expand all
70 } // namespace 70 } // namespace
71 71
72 class PushMessagingBrowserTest : public InProcessBrowserTest { 72 class PushMessagingBrowserTest : public InProcessBrowserTest {
73 public: 73 public:
74 PushMessagingBrowserTest() : gcm_service_(nullptr) {} 74 PushMessagingBrowserTest() : gcm_service_(nullptr) {}
75 ~PushMessagingBrowserTest() override {} 75 ~PushMessagingBrowserTest() override {}
76 76
77 // InProcessBrowserTest: 77 // InProcessBrowserTest:
78 void SetUpCommandLine(base::CommandLine* command_line) override { 78 void SetUpCommandLine(base::CommandLine* command_line) override {
79 command_line->AppendSwitch(switches::kEnablePushMessagePayload); 79 command_line->AppendSwitch(switches::kEnablePushMessagePayload);
80 command_line->AppendSwitch(switches::kEnablePermissionsBubbles);
81 EXPECT_TRUE(PermissionBubbleManager::Enabled());
80 82
81 InProcessBrowserTest::SetUpCommandLine(command_line); 83 InProcessBrowserTest::SetUpCommandLine(command_line);
82 } 84 }
83 85
84 // InProcessBrowserTest: 86 // InProcessBrowserTest:
85 void SetUp() override { 87 void SetUp() override {
msw 2015/06/05 01:51:59 Make SetUp and TearDown clear the auto-response (s
felt 2015/06/05 06:37:29 That's unnecessary here. The PermissionBubbleManag
86 https_server_.reset(new net::SpawnedTestServer( 88 https_server_.reset(new net::SpawnedTestServer(
87 net::SpawnedTestServer::TYPE_HTTPS, 89 net::SpawnedTestServer::TYPE_HTTPS,
88 net::BaseTestServer::SSLOptions( 90 net::BaseTestServer::SSLOptions(
89 net::BaseTestServer::SSLOptions::CERT_OK), 91 net::BaseTestServer::SSLOptions::CERT_OK),
90 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/")))); 92 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/"))));
91 ASSERT_TRUE(https_server_->Start()); 93 ASSERT_TRUE(https_server_->Start());
92 94
93 #if defined(ENABLE_NOTIFICATIONS) 95 #if defined(ENABLE_NOTIFICATIONS)
94 notification_manager_.reset(new StubNotificationUIManager); 96 notification_manager_.reset(new StubNotificationUIManager);
95 notification_service()->SetNotificationUIManagerForTesting( 97 notification_service()->SetNotificationUIManagerForTesting(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 138
137 bool RunScript(const std::string& script, std::string* result, 139 bool RunScript(const std::string& script, std::string* result,
138 content::WebContents* web_contents) { 140 content::WebContents* web_contents) {
139 if (!web_contents) 141 if (!web_contents)
140 web_contents = GetBrowser()->tab_strip_model()->GetActiveWebContents(); 142 web_contents = GetBrowser()->tab_strip_model()->GetActiveWebContents();
141 return content::ExecuteScriptAndExtractString(web_contents->GetMainFrame(), 143 return content::ExecuteScriptAndExtractString(web_contents->GetMainFrame(),
142 script, 144 script,
143 result); 145 result);
144 } 146 }
145 147
148 PermissionBubbleManager* GetPermissionBubbleManager() {
149 return PermissionBubbleManager::FromWebContents(
150 GetBrowser()->tab_strip_model()->GetActiveWebContents());
151 }
152
153 void PrepareToAcceptPermission();
154 void RequestAndAcceptPermission();
155 void RequestAndDenyPermission();
156
146 void TryToSubscribeSuccessfully( 157 void TryToSubscribeSuccessfully(
147 const std::string& expected_push_subscription_id); 158 const std::string& expected_push_subscription_id);
148 159
149 std::string GetEndpointForSubscriptionId(const std::string& subscription_id) { 160 std::string GetEndpointForSubscriptionId(const std::string& subscription_id) {
150 return std::string(kPushMessagingEndpoint) + "/" + subscription_id; 161 return std::string(kPushMessagingEndpoint) + "/" + subscription_id;
151 } 162 }
152 163
153 PushMessagingAppIdentifier GetAppIdentifierForServiceWorkerRegistration( 164 PushMessagingAppIdentifier GetAppIdentifierForServiceWorkerRegistration(
154 int64 service_worker_registration_id); 165 int64 service_worker_registration_id);
155 166
(...skipping 29 matching lines...) Expand all
185 196
186 PushMessagingServiceImpl* push_service() const { return push_service_; } 197 PushMessagingServiceImpl* push_service() const { return push_service_; }
187 198
188 protected: 199 protected:
189 virtual std::string GetTestURL() { 200 virtual std::string GetTestURL() {
190 return "files/push_messaging/test.html"; 201 return "files/push_messaging/test.html";
191 } 202 }
192 203
193 virtual Browser* GetBrowser() const { return browser(); } 204 virtual Browser* GetBrowser() const { return browser(); }
194 205
195 InfoBarService* GetInfoBarService() {
196 return InfoBarService::FromWebContents(
197 GetBrowser()->tab_strip_model()->GetActiveWebContents());
198 }
199
200 private: 206 private:
201 scoped_ptr<net::SpawnedTestServer> https_server_; 207 scoped_ptr<net::SpawnedTestServer> https_server_;
202 gcm::FakeGCMProfileService* gcm_service_; 208 gcm::FakeGCMProfileService* gcm_service_;
203 PushMessagingServiceImpl* push_service_; 209 PushMessagingServiceImpl* push_service_;
204 210
205 #if defined(ENABLE_NOTIFICATIONS) 211 #if defined(ENABLE_NOTIFICATIONS)
206 scoped_ptr<StubNotificationUIManager> notification_manager_; 212 scoped_ptr<StubNotificationUIManager> notification_manager_;
207 #endif 213 #endif
208 214
209 DISALLOW_COPY_AND_ASSIGN(PushMessagingBrowserTest); 215 DISALLOW_COPY_AND_ASSIGN(PushMessagingBrowserTest);
210 }; 216 };
211 217
212 class PushMessagingBrowserTestEmptySubscriptionOptions 218 class PushMessagingBrowserTestEmptySubscriptionOptions
213 : public PushMessagingBrowserTest { 219 : public PushMessagingBrowserTest {
214 std::string GetTestURL() override { 220 std::string GetTestURL() override {
215 return "files/push_messaging/test_no_subscription_options.html"; 221 return "files/push_messaging/test_no_subscription_options.html";
216 } 222 }
217 }; 223 };
218 224
225 void PushMessagingBrowserTest::PrepareToAcceptPermission() {
226 GetPermissionBubbleManager()->set_auto_response_for_testing_only_(
msw 2015/06/05 01:51:59 optional nit: just inline this (if you make the se
felt 2015/06/05 06:37:29 Done.
227 PermissionBubbleManager::ACCEPT_ALL);
228 }
229
230 void PushMessagingBrowserTest::RequestAndAcceptPermission() {
231 std::string script_result;
232
233 GetPermissionBubbleManager()->set_auto_response_for_testing_only_(
234 PermissionBubbleManager::ACCEPT_ALL);
235 EXPECT_TRUE(RunScript("requestNotificationPermission();", &script_result));
236 EXPECT_EQ("permission status - granted", script_result);
237 }
238
239 void PushMessagingBrowserTest::RequestAndDenyPermission() {
240 std::string script_result;
241
242 GetPermissionBubbleManager()->set_auto_response_for_testing_only_(
243 PermissionBubbleManager::DENY_ALL);
244 EXPECT_TRUE(RunScript("requestNotificationPermission();", &script_result));
245 EXPECT_EQ("permission status - denied", script_result);
246 }
247
219 void PushMessagingBrowserTest::TryToSubscribeSuccessfully( 248 void PushMessagingBrowserTest::TryToSubscribeSuccessfully(
220 const std::string& expected_push_subscription_id) { 249 const std::string& expected_push_subscription_id) {
221 std::string script_result; 250 std::string script_result;
222 251
223 EXPECT_TRUE(RunScript("registerServiceWorker()", &script_result)); 252 EXPECT_TRUE(RunScript("registerServiceWorker()", &script_result));
224 EXPECT_EQ("ok - service worker registered", script_result); 253 EXPECT_EQ("ok - service worker registered", script_result);
225 254
226 InfoBarResponder accepting_responder(GetInfoBarService(), true); 255 RequestAndAcceptPermission();
227 EXPECT_TRUE(RunScript("requestNotificationPermission()", &script_result));
228 EXPECT_EQ("permission status - granted", script_result);
229 256
230 EXPECT_TRUE(RunScript("subscribePush()", &script_result)); 257 EXPECT_TRUE(RunScript("subscribePush()", &script_result));
231 EXPECT_EQ(GetEndpointForSubscriptionId(expected_push_subscription_id), 258 EXPECT_EQ(GetEndpointForSubscriptionId(expected_push_subscription_id),
232 script_result); 259 script_result);
233 } 260 }
234 261
235 PushMessagingAppIdentifier 262 PushMessagingAppIdentifier
236 PushMessagingBrowserTest::GetAppIdentifierForServiceWorkerRegistration( 263 PushMessagingBrowserTest::GetAppIdentifierForServiceWorkerRegistration(
237 int64 service_worker_registration_id) { 264 int64 service_worker_registration_id) {
238 GURL origin = https_server()->GetURL(std::string()).GetOrigin(); 265 GURL origin = https_server()->GetURL(std::string()).GetOrigin();
(...skipping 23 matching lines...) Expand all
262 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); 289 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]);
263 } 290 }
264 291
265 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, 292 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
266 SubscribeSuccessNotificationsPrompt) { 293 SubscribeSuccessNotificationsPrompt) {
267 std::string script_result; 294 std::string script_result;
268 295
269 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 296 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
270 ASSERT_EQ("ok - service worker registered", script_result); 297 ASSERT_EQ("ok - service worker registered", script_result);
271 298
272 InfoBarResponder accepting_responder(GetInfoBarService(), true); 299 PrepareToAcceptPermission();
273 ASSERT_TRUE(RunScript("subscribePush()", &script_result)); 300 ASSERT_TRUE(RunScript("subscribePush()", &script_result));
274 EXPECT_EQ(GetEndpointForSubscriptionId("1-0"), 301 EXPECT_EQ(GetEndpointForSubscriptionId("1-0"),
275 script_result); 302 script_result);
276 303
277 PushMessagingAppIdentifier app_identifier = 304 PushMessagingAppIdentifier app_identifier =
278 GetAppIdentifierForServiceWorkerRegistration(0LL); 305 GetAppIdentifierForServiceWorkerRegistration(0LL);
279 EXPECT_EQ(app_identifier.app_id(), gcm_service()->last_registered_app_id()); 306 EXPECT_EQ(app_identifier.app_id(), gcm_service()->last_registered_app_id());
280 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); 307 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]);
281 } 308 }
282 309
283 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, 310 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
284 SubscribeFailureNotificationsBlocked) { 311 SubscribeFailureNotificationsBlocked) {
285 std::string script_result; 312 std::string script_result;
286 313
287 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 314 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
288 ASSERT_EQ("ok - service worker registered", script_result); 315 ASSERT_EQ("ok - service worker registered", script_result);
289 316
290 InfoBarResponder cancelling_responder(GetInfoBarService(), false); 317 RequestAndDenyPermission();
291 ASSERT_TRUE(RunScript("requestNotificationPermission();", &script_result));
292 ASSERT_EQ("permission status - denied", script_result);
293 318
294 ASSERT_TRUE(RunScript("subscribePush()", &script_result)); 319 ASSERT_TRUE(RunScript("subscribePush()", &script_result));
295 EXPECT_EQ("AbortError - Registration failed - permission denied", 320 EXPECT_EQ("AbortError - Registration failed - permission denied",
296 script_result); 321 script_result);
297 } 322 }
298 323
299 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeFailureNoManifest) { 324 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeFailureNoManifest) {
300 std::string script_result; 325 std::string script_result;
301 326
302 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 327 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
303 ASSERT_EQ("ok - service worker registered", script_result); 328 ASSERT_EQ("ok - service worker registered", script_result);
304 329
305 InfoBarResponder accepting_responder(GetInfoBarService(), true); 330 RequestAndAcceptPermission();
306 ASSERT_TRUE(RunScript("requestNotificationPermission();", &script_result));
307 ASSERT_EQ("permission status - granted", script_result);
308 331
309 ASSERT_TRUE(RunScript("removeManifest()", &script_result)); 332 ASSERT_TRUE(RunScript("removeManifest()", &script_result));
310 ASSERT_EQ("manifest removed", script_result); 333 ASSERT_EQ("manifest removed", script_result);
311 334
312 ASSERT_TRUE(RunScript("subscribePush()", &script_result)); 335 ASSERT_TRUE(RunScript("subscribePush()", &script_result));
313 EXPECT_EQ("AbortError - Registration failed - no sender id provided", 336 EXPECT_EQ("AbortError - Registration failed - no sender id provided",
314 script_result); 337 script_result);
315 } 338 }
316 339
317 // TODO(johnme): Test subscribing from a worker - see https://crbug.com/437298. 340 // TODO(johnme): Test subscribing from a worker - see https://crbug.com/437298.
318 341
319 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTestEmptySubscriptionOptions, 342 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTestEmptySubscriptionOptions,
320 RegisterFailureEmptyPushSubscriptionOptions) { 343 RegisterFailureEmptyPushSubscriptionOptions) {
321 std::string script_result; 344 std::string script_result;
322 345
323 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 346 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
324 ASSERT_EQ("ok - service worker registered", script_result); 347 ASSERT_EQ("ok - service worker registered", script_result);
325 348
326 InfoBarResponder accepting_responder(GetInfoBarService(), true); 349 RequestAndAcceptPermission();
327 ASSERT_TRUE(RunScript("requestNotificationPermission();", &script_result));
328 ASSERT_EQ("permission status - granted", script_result);
329 350
330 ASSERT_TRUE(RunScript("subscribePush()", &script_result)); 351 ASSERT_TRUE(RunScript("subscribePush()", &script_result));
331 EXPECT_EQ("AbortError - Registration failed - permission denied", 352 EXPECT_EQ("AbortError - Registration failed - permission denied",
332 script_result); 353 script_result);
333 } 354 }
334 355
335 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribePersisted) { 356 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribePersisted) {
336 std::string script_result; 357 std::string script_result;
337 358
338 // First, test that Service Worker registration IDs are assigned in order of 359 // First, test that Service Worker registration IDs are assigned in order of
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 ASSERT_TRUE(RunScript("permissionState()", &script_result)); 690 ASSERT_TRUE(RunScript("permissionState()", &script_result));
670 ASSERT_EQ("permission status - prompt", script_result); 691 ASSERT_EQ("permission status - prompt", script_result);
671 } 692 }
672 693
673 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PermissionStateSaysGranted) { 694 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PermissionStateSaysGranted) {
674 std::string script_result; 695 std::string script_result;
675 696
676 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 697 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
677 ASSERT_EQ("ok - service worker registered", script_result); 698 ASSERT_EQ("ok - service worker registered", script_result);
678 699
679 InfoBarResponder accepting_responder(GetInfoBarService(), true); 700 RequestAndAcceptPermission();
680 ASSERT_TRUE(RunScript("requestNotificationPermission();", &script_result));
681 EXPECT_EQ("permission status - granted", script_result);
682 701
683 ASSERT_TRUE(RunScript("subscribePush()", &script_result)); 702 ASSERT_TRUE(RunScript("subscribePush()", &script_result));
684 EXPECT_EQ(GetEndpointForSubscriptionId("1-0"), 703 EXPECT_EQ(GetEndpointForSubscriptionId("1-0"),
685 script_result); 704 script_result);
686 705
687 ASSERT_TRUE(RunScript("permissionState()", &script_result)); 706 ASSERT_TRUE(RunScript("permissionState()", &script_result));
688 EXPECT_EQ("permission status - granted", script_result); 707 EXPECT_EQ("permission status - granted", script_result);
689 } 708 }
690 709
691 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PermissionStateSaysDenied) { 710 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PermissionStateSaysDenied) {
692 std::string script_result; 711 std::string script_result;
693 712
694 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 713 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
695 ASSERT_EQ("ok - service worker registered", script_result); 714 ASSERT_EQ("ok - service worker registered", script_result);
696 715
697 InfoBarResponder cancelling_responder(GetInfoBarService(), false); 716 RequestAndDenyPermission();
698 ASSERT_TRUE(RunScript("requestNotificationPermission();", &script_result));
699 EXPECT_EQ("permission status - denied", script_result);
700 717
701 ASSERT_TRUE(RunScript("subscribePush()", &script_result)); 718 ASSERT_TRUE(RunScript("subscribePush()", &script_result));
702 EXPECT_EQ("AbortError - Registration failed - permission denied", 719 EXPECT_EQ("AbortError - Registration failed - permission denied",
703 script_result); 720 script_result);
704 721
705 ASSERT_TRUE(RunScript("permissionState()", &script_result)); 722 ASSERT_TRUE(RunScript("permissionState()", &script_result));
706 EXPECT_EQ("permission status - denied", script_result); 723 EXPECT_EQ("permission status - denied", script_result);
707 } 724 }
708 725
709 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnsubscribeSuccess) { 726 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnsubscribeSuccess) {
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 std::string script_result; 1128 std::string script_result;
1112 1129
1113 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 1130 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
1114 ASSERT_EQ("ok - service worker registered", script_result); 1131 ASSERT_EQ("ok - service worker registered", script_result);
1115 1132
1116 // In Incognito mode the promise returned by getSubscription should not hang, 1133 // In Incognito mode the promise returned by getSubscription should not hang,
1117 // it should just fulfill with null. 1134 // it should just fulfill with null.
1118 ASSERT_TRUE(RunScript("hasSubscription()", &script_result)); 1135 ASSERT_TRUE(RunScript("hasSubscription()", &script_result));
1119 ASSERT_EQ("false - not subscribed", script_result); 1136 ASSERT_EQ("false - not subscribed", script_result);
1120 } 1137 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698