OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, | 413 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, |
414 SubscribeFailureNotificationsBlocked) { | 414 SubscribeFailureNotificationsBlocked) { |
415 std::string script_result; | 415 std::string script_result; |
416 | 416 |
417 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); | 417 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); |
418 ASSERT_EQ("ok - service worker registered", script_result); | 418 ASSERT_EQ("ok - service worker registered", script_result); |
419 | 419 |
420 RequestAndDenyPermission(); | 420 RequestAndDenyPermission(); |
421 | 421 |
422 ASSERT_TRUE(RunScript("documentSubscribePush()", &script_result)); | 422 ASSERT_TRUE(RunScript("documentSubscribePush()", &script_result)); |
423 EXPECT_EQ("PermissionDeniedError - Registration failed - permission denied", | 423 EXPECT_EQ("NotAllowedError - Registration failed - permission denied", |
424 script_result); | 424 script_result); |
425 } | 425 } |
426 | 426 |
427 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeFailureNoManifest) { | 427 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeFailureNoManifest) { |
428 std::string script_result; | 428 std::string script_result; |
429 | 429 |
430 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); | 430 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); |
431 ASSERT_EQ("ok - service worker registered", script_result); | 431 ASSERT_EQ("ok - service worker registered", script_result); |
432 | 432 |
433 RequestAndAcceptPermission(); | 433 RequestAndAcceptPermission(); |
(...skipping 29 matching lines...) Expand all Loading... |
463 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTestEmptySubscriptionOptions, | 463 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTestEmptySubscriptionOptions, |
464 RegisterFailureEmptyPushSubscriptionOptions) { | 464 RegisterFailureEmptyPushSubscriptionOptions) { |
465 std::string script_result; | 465 std::string script_result; |
466 | 466 |
467 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); | 467 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); |
468 ASSERT_EQ("ok - service worker registered", script_result); | 468 ASSERT_EQ("ok - service worker registered", script_result); |
469 | 469 |
470 RequestAndAcceptPermission(); | 470 RequestAndAcceptPermission(); |
471 | 471 |
472 ASSERT_TRUE(RunScript("documentSubscribePush()", &script_result)); | 472 ASSERT_TRUE(RunScript("documentSubscribePush()", &script_result)); |
473 EXPECT_EQ("PermissionDeniedError - Registration failed - permission denied", | 473 EXPECT_EQ("NotAllowedError - Registration failed - permission denied", |
474 script_result); | 474 script_result); |
475 } | 475 } |
476 | 476 |
477 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeWorker) { | 477 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, SubscribeWorker) { |
478 std::string script_result; | 478 std::string script_result; |
479 | 479 |
480 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); | 480 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); |
481 ASSERT_EQ("ok - service worker registered", script_result); | 481 ASSERT_EQ("ok - service worker registered", script_result); |
482 | 482 |
483 RequestAndAcceptPermission(); | 483 RequestAndAcceptPermission(); |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 | 1079 |
1080 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PermissionStateSaysDenied) { | 1080 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PermissionStateSaysDenied) { |
1081 std::string script_result; | 1081 std::string script_result; |
1082 | 1082 |
1083 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); | 1083 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); |
1084 ASSERT_EQ("ok - service worker registered", script_result); | 1084 ASSERT_EQ("ok - service worker registered", script_result); |
1085 | 1085 |
1086 RequestAndDenyPermission(); | 1086 RequestAndDenyPermission(); |
1087 | 1087 |
1088 ASSERT_TRUE(RunScript("documentSubscribePush()", &script_result)); | 1088 ASSERT_TRUE(RunScript("documentSubscribePush()", &script_result)); |
1089 EXPECT_EQ("PermissionDeniedError - Registration failed - permission denied", | 1089 EXPECT_EQ("NotAllowedError - Registration failed - permission denied", |
1090 script_result); | 1090 script_result); |
1091 | 1091 |
1092 ASSERT_TRUE(RunScript("permissionState()", &script_result)); | 1092 ASSERT_TRUE(RunScript("permissionState()", &script_result)); |
1093 EXPECT_EQ("permission status - denied", script_result); | 1093 EXPECT_EQ("permission status - denied", script_result); |
1094 } | 1094 } |
1095 | 1095 |
1096 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnsubscribeSuccess) { | 1096 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnsubscribeSuccess) { |
1097 std::string script_result; | 1097 std::string script_result; |
1098 | 1098 |
1099 EXPECT_TRUE(RunScript("registerServiceWorker()", &script_result)); | 1099 EXPECT_TRUE(RunScript("registerServiceWorker()", &script_result)); |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 ASSERT_FALSE(background_mode_manager->IsBackgroundModeActive()); | 1573 ASSERT_FALSE(background_mode_manager->IsBackgroundModeActive()); |
1574 | 1574 |
1575 // After dropping the last subscription background mode is still inactive. | 1575 // After dropping the last subscription background mode is still inactive. |
1576 std::string script_result; | 1576 std::string script_result; |
1577 gcm_service()->AddExpectedUnregisterResponse(gcm::GCMClient::SUCCESS); | 1577 gcm_service()->AddExpectedUnregisterResponse(gcm::GCMClient::SUCCESS); |
1578 ASSERT_TRUE(RunScript("unsubscribePush()", &script_result)); | 1578 ASSERT_TRUE(RunScript("unsubscribePush()", &script_result)); |
1579 EXPECT_EQ("unsubscribe result: true", script_result); | 1579 EXPECT_EQ("unsubscribe result: true", script_result); |
1580 ASSERT_FALSE(background_mode_manager->IsBackgroundModeActive()); | 1580 ASSERT_FALSE(background_mode_manager->IsBackgroundModeActive()); |
1581 } | 1581 } |
1582 #endif // BUILDFLAG(ENABLE_BACKGROUND) && !defined(OS_CHROMEOS) | 1582 #endif // BUILDFLAG(ENABLE_BACKGROUND) && !defined(OS_CHROMEOS) |
OLD | NEW |