| 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
| 13 #include "chrome/browser/notifications/notification_test_util.h" | 13 #include "chrome/browser/notifications/notification_test_util.h" |
| 14 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 14 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/push_messaging/push_messaging_application_id.h" |
| 17 #include "chrome/browser/push_messaging/push_messaging_constants.h" |
| 18 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" |
| 19 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 16 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" | 20 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" |
| 17 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 21 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 18 #include "chrome/browser/services/gcm/push_messaging_application_id.h" | |
| 19 #include "chrome/browser/services/gcm/push_messaging_constants.h" | |
| 20 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 23 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 22 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
| 23 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
| 24 #include "components/content_settings/core/browser/host_content_settings_map.h" | 26 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 25 #include "components/content_settings/core/common/content_settings.h" | 27 #include "components/content_settings/core/common/content_settings.h" |
| 26 #include "components/content_settings/core/common/content_settings_types.h" | 28 #include "components/content_settings/core/common/content_settings_types.h" |
| 27 #include "components/gcm_driver/gcm_client.h" | 29 #include "components/gcm_driver/gcm_client.h" |
| 28 #include "components/infobars/core/confirm_infobar_delegate.h" | 30 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 29 #include "components/infobars/core/infobar.h" | 31 #include "components/infobars/core/infobar.h" |
| 30 #include "components/infobars/core/infobar_manager.h" | 32 #include "components/infobars/core/infobar_manager.h" |
| 31 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
| 33 #include "content/public/test/browser_test_utils.h" | 35 #include "content/public/test/browser_test_utils.h" |
| 34 #include "ui/base/window_open_disposition.h" | 36 #include "ui/base/window_open_disposition.h" |
| 35 | 37 |
| 36 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
| 37 #include "base/android/build_info.h" | 39 #include "base/android/build_info.h" |
| 38 #endif | 40 #endif |
| 39 | 41 |
| 40 namespace gcm { | |
| 41 | |
| 42 namespace { | 42 namespace { |
| 43 // Responds to a confirm infobar by accepting or cancelling it. Responds to at | 43 // Responds to a confirm infobar by accepting or cancelling it. Responds to at |
| 44 // most one infobar. | 44 // most one infobar. |
| 45 class InfoBarResponder : public infobars::InfoBarManager::Observer { | 45 class InfoBarResponder : public infobars::InfoBarManager::Observer { |
| 46 public: | 46 public: |
| 47 InfoBarResponder(Browser* browser, bool accept) | 47 InfoBarResponder(Browser* browser, bool accept) |
| 48 : infobar_service_(InfoBarService::FromWebContents( | 48 : infobar_service_(InfoBarService::FromWebContents( |
| 49 browser->tab_strip_model()->GetActiveWebContents())), | 49 browser->tab_strip_model()->GetActiveWebContents())), |
| 50 accept_(accept), | 50 accept_(accept), |
| 51 has_observed_(false) { | 51 has_observed_(false) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 notification_manager_.reset(new StubNotificationUIManager); | 185 notification_manager_.reset(new StubNotificationUIManager); |
| 186 notification_service()->SetNotificationUIManagerForTesting( | 186 notification_service()->SetNotificationUIManagerForTesting( |
| 187 notification_manager()); | 187 notification_manager()); |
| 188 #endif | 188 #endif |
| 189 | 189 |
| 190 InProcessBrowserTest::SetUp(); | 190 InProcessBrowserTest::SetUp(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 // InProcessBrowserTest: | 193 // InProcessBrowserTest: |
| 194 void SetUpOnMainThread() override { | 194 void SetUpOnMainThread() override { |
| 195 gcm_service_ = static_cast<FakeGCMProfileService*>( | 195 gcm_service_ = static_cast<gcm::FakeGCMProfileService*>( |
| 196 GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 196 gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 197 browser()->profile(), &FakeGCMProfileService::Build)); | 197 browser()->profile(), &gcm::FakeGCMProfileService::Build)); |
| 198 gcm_service_->set_collect(true); | 198 gcm_service_->set_collect(true); |
| 199 push_service_ = |
| 200 PushMessagingServiceFactory::GetForProfile(browser()->profile()); |
| 199 | 201 |
| 200 LoadTestPage(); | 202 LoadTestPage(); |
| 201 | 203 |
| 202 InProcessBrowserTest::SetUpOnMainThread(); | 204 InProcessBrowserTest::SetUpOnMainThread(); |
| 203 } | 205 } |
| 204 | 206 |
| 205 // InProcessBrowserTest: | 207 // InProcessBrowserTest: |
| 206 void TearDown() override { | 208 void TearDown() override { |
| 207 #if defined(ENABLE_NOTIFICATIONS) | 209 #if defined(ENABLE_NOTIFICATIONS) |
| 208 notification_service()->SetNotificationUIManagerForTesting(nullptr); | 210 notification_service()->SetNotificationUIManagerForTesting(nullptr); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 233 } | 235 } |
| 234 | 236 |
| 235 void TryToRegisterSuccessfully( | 237 void TryToRegisterSuccessfully( |
| 236 const std::string& expected_push_registration_id); | 238 const std::string& expected_push_registration_id); |
| 237 | 239 |
| 238 PushMessagingApplicationId GetServiceWorkerAppId( | 240 PushMessagingApplicationId GetServiceWorkerAppId( |
| 239 int64 service_worker_registration_id); | 241 int64 service_worker_registration_id); |
| 240 | 242 |
| 241 net::SpawnedTestServer* https_server() const { return https_server_.get(); } | 243 net::SpawnedTestServer* https_server() const { return https_server_.get(); } |
| 242 | 244 |
| 243 FakeGCMProfileService* gcm_service() const { return gcm_service_; } | 245 gcm::FakeGCMProfileService* gcm_service() const { return gcm_service_; } |
| 244 | 246 |
| 245 #if defined(ENABLE_NOTIFICATIONS) | 247 #if defined(ENABLE_NOTIFICATIONS) |
| 246 StubNotificationUIManager* notification_manager() const { | 248 StubNotificationUIManager* notification_manager() const { |
| 247 return notification_manager_.get(); | 249 return notification_manager_.get(); |
| 248 } | 250 } |
| 249 | 251 |
| 250 PlatformNotificationServiceImpl* notification_service() const { | 252 PlatformNotificationServiceImpl* notification_service() const { |
| 251 return PlatformNotificationServiceImpl::GetInstance(); | 253 return PlatformNotificationServiceImpl::GetInstance(); |
| 252 } | 254 } |
| 253 #endif | 255 #endif |
| 254 | 256 |
| 255 PushMessagingServiceImpl* push_service() { | 257 PushMessagingServiceImpl* push_service() const { return push_service_; } |
| 256 return static_cast<PushMessagingServiceImpl*>( | |
| 257 gcm_service_->push_messaging_service()); | |
| 258 } | |
| 259 | 258 |
| 260 protected: | 259 protected: |
| 261 virtual std::string GetTestURL() { | 260 virtual std::string GetTestURL() { |
| 262 return "files/push_messaging/test.html"; | 261 return "files/push_messaging/test.html"; |
| 263 } | 262 } |
| 264 | 263 |
| 265 private: | 264 private: |
| 266 scoped_ptr<net::SpawnedTestServer> https_server_; | 265 scoped_ptr<net::SpawnedTestServer> https_server_; |
| 267 FakeGCMProfileService* gcm_service_; | 266 gcm::FakeGCMProfileService* gcm_service_; |
| 267 PushMessagingServiceImpl* push_service_; |
| 268 scoped_ptr<StubNotificationUIManager> notification_manager_; | 268 scoped_ptr<StubNotificationUIManager> notification_manager_; |
| 269 | 269 |
| 270 DISALLOW_COPY_AND_ASSIGN(PushMessagingBrowserTest); | 270 DISALLOW_COPY_AND_ASSIGN(PushMessagingBrowserTest); |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 class PushMessagingBadManifestBrowserTest : public PushMessagingBrowserTest { | 273 class PushMessagingBadManifestBrowserTest : public PushMessagingBrowserTest { |
| 274 std::string GetTestURL() override { | 274 std::string GetTestURL() override { |
| 275 return "files/push_messaging/test_bad_manifest.html"; | 275 return "files/push_messaging/test_bad_manifest.html"; |
| 276 } | 276 } |
| 277 }; | 277 }; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); | 458 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); |
| 459 | 459 |
| 460 ASSERT_TRUE(RunScript("isControlled()", &script_result)); | 460 ASSERT_TRUE(RunScript("isControlled()", &script_result)); |
| 461 ASSERT_EQ("false - is not controlled", script_result); | 461 ASSERT_EQ("false - is not controlled", script_result); |
| 462 | 462 |
| 463 LoadTestPage(); // Reload to become controlled. | 463 LoadTestPage(); // Reload to become controlled. |
| 464 | 464 |
| 465 ASSERT_TRUE(RunScript("isControlled()", &script_result)); | 465 ASSERT_TRUE(RunScript("isControlled()", &script_result)); |
| 466 ASSERT_EQ("true - is controlled", script_result); | 466 ASSERT_EQ("true - is controlled", script_result); |
| 467 | 467 |
| 468 GCMClient::IncomingMessage message; | 468 gcm::GCMClient::IncomingMessage message; |
| 469 message.sender_id = "1234567890"; | 469 message.sender_id = "1234567890"; |
| 470 message.data["data"] = "testdata"; | 470 message.data["data"] = "testdata"; |
| 471 push_service()->OnMessage(app_id.app_id_guid(), message); | 471 push_service()->OnMessage(app_id.app_id_guid(), message); |
| 472 ASSERT_TRUE(RunScript("resultQueue.pop()", &script_result)); | 472 ASSERT_TRUE(RunScript("resultQueue.pop()", &script_result)); |
| 473 EXPECT_EQ("testdata", script_result); | 473 EXPECT_EQ("testdata", script_result); |
| 474 } | 474 } |
| 475 | 475 |
| 476 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PushEventNoServiceWorker) { | 476 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PushEventNoServiceWorker) { |
| 477 if (!IsPushSupported()) | 477 if (!IsPushSupported()) |
| 478 return; | 478 return; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 496 // Unregister service worker. Sending a message should now fail. | 496 // Unregister service worker. Sending a message should now fail. |
| 497 ASSERT_TRUE(RunScript("unregisterServiceWorker()", &script_result)); | 497 ASSERT_TRUE(RunScript("unregisterServiceWorker()", &script_result)); |
| 498 ASSERT_EQ("service worker unregistration status: true", script_result); | 498 ASSERT_EQ("service worker unregistration status: true", script_result); |
| 499 | 499 |
| 500 // When the push service will receive it next message, given that there is no | 500 // When the push service will receive it next message, given that there is no |
| 501 // SW available, it should unregister |app_id|. | 501 // SW available, it should unregister |app_id|. |
| 502 UnregistrationCallback callback; | 502 UnregistrationCallback callback; |
| 503 gcm_service()->SetUnregisterCallback(base::Bind(&UnregistrationCallback::Run, | 503 gcm_service()->SetUnregisterCallback(base::Bind(&UnregistrationCallback::Run, |
| 504 base::Unretained(&callback))); | 504 base::Unretained(&callback))); |
| 505 | 505 |
| 506 GCMClient::IncomingMessage message; | 506 gcm::GCMClient::IncomingMessage message; |
| 507 message.sender_id = "1234567890"; | 507 message.sender_id = "1234567890"; |
| 508 message.data["data"] = "testdata"; | 508 message.data["data"] = "testdata"; |
| 509 push_service()->OnMessage(app_id.app_id_guid(), message); | 509 push_service()->OnMessage(app_id.app_id_guid(), message); |
| 510 | 510 |
| 511 callback.WaitUntilSatisfied(); | 511 callback.WaitUntilSatisfied(); |
| 512 EXPECT_EQ(app_id.app_id_guid(), callback.app_id()); | 512 EXPECT_EQ(app_id.app_id_guid(), callback.app_id()); |
| 513 | 513 |
| 514 // No push data should have been received. | 514 // No push data should have been received. |
| 515 ASSERT_TRUE(RunScript("resultQueue.popImmediately()", &script_result)); | 515 ASSERT_TRUE(RunScript("resultQueue.popImmediately()", &script_result)); |
| 516 EXPECT_EQ("null", script_result); | 516 EXPECT_EQ("null", script_result); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 541 notification_manager()->CancelAll(); | 541 notification_manager()->CancelAll(); |
| 542 ASSERT_EQ(0u, notification_manager()->GetNotificationCount()); | 542 ASSERT_EQ(0u, notification_manager()->GetNotificationCount()); |
| 543 | 543 |
| 544 // We'll need to specify the web_contents in which to eval script, since we're | 544 // We'll need to specify the web_contents in which to eval script, since we're |
| 545 // going to run script in a background tab. | 545 // going to run script in a background tab. |
| 546 content::WebContents* web_contents = | 546 content::WebContents* web_contents = |
| 547 browser()->tab_strip_model()->GetActiveWebContents(); | 547 browser()->tab_strip_model()->GetActiveWebContents(); |
| 548 | 548 |
| 549 // If the site is visible in an active tab, we should not force a notification | 549 // If the site is visible in an active tab, we should not force a notification |
| 550 // to be shown. Try it twice, since we allow one mistake per 10 push events. | 550 // to be shown. Try it twice, since we allow one mistake per 10 push events. |
| 551 GCMClient::IncomingMessage message; | 551 gcm::GCMClient::IncomingMessage message; |
| 552 message.sender_id = "1234567890"; | 552 message.sender_id = "1234567890"; |
| 553 for (int n = 0; n < 2; n++) { | 553 for (int n = 0; n < 2; n++) { |
| 554 message.data["data"] = "testdata"; | 554 message.data["data"] = "testdata"; |
| 555 push_service()->OnMessage(app_id.app_id_guid(), message); | 555 push_service()->OnMessage(app_id.app_id_guid(), message); |
| 556 ASSERT_TRUE(RunScript("resultQueue.pop()", &script_result)); | 556 ASSERT_TRUE(RunScript("resultQueue.pop()", &script_result)); |
| 557 EXPECT_EQ("testdata", script_result); | 557 EXPECT_EQ("testdata", script_result); |
| 558 EXPECT_EQ(0u, notification_manager()->GetNotificationCount()); | 558 EXPECT_EQ(0u, notification_manager()->GetNotificationCount()); |
| 559 } | 559 } |
| 560 | 560 |
| 561 // Open a blank foreground tab so site is no longer visible. | 561 // Open a blank foreground tab so site is no longer visible. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 | 632 |
| 633 LoadTestPage(); // Reload to become controlled. | 633 LoadTestPage(); // Reload to become controlled. |
| 634 | 634 |
| 635 ASSERT_TRUE(RunScript("isControlled()", &script_result)); | 635 ASSERT_TRUE(RunScript("isControlled()", &script_result)); |
| 636 ASSERT_EQ("true - is controlled", script_result); | 636 ASSERT_EQ("true - is controlled", script_result); |
| 637 | 637 |
| 638 NotificationAddedCallback callback; | 638 NotificationAddedCallback callback; |
| 639 notification_manager()->SetNotificationAddedCallback( | 639 notification_manager()->SetNotificationAddedCallback( |
| 640 base::Bind(&NotificationAddedCallback::Run, base::Unretained(&callback))); | 640 base::Bind(&NotificationAddedCallback::Run, base::Unretained(&callback))); |
| 641 | 641 |
| 642 GCMClient::IncomingMessage message; | 642 gcm::GCMClient::IncomingMessage message; |
| 643 message.sender_id = "1234567890"; | 643 message.sender_id = "1234567890"; |
| 644 message.data["data"] = "shownotification-without-waituntil"; | 644 message.data["data"] = "shownotification-without-waituntil"; |
| 645 push_service()->OnMessage(app_id.app_id_guid(), message); | 645 push_service()->OnMessage(app_id.app_id_guid(), message); |
| 646 ASSERT_TRUE(RunScript("resultQueue.pop()", &script_result, web_contents)); | 646 ASSERT_TRUE(RunScript("resultQueue.pop()", &script_result, web_contents)); |
| 647 EXPECT_EQ("immediate:shownotification-without-waituntil", script_result); | 647 EXPECT_EQ("immediate:shownotification-without-waituntil", script_result); |
| 648 | 648 |
| 649 callback.WaitUntilSatisfied(); | 649 callback.WaitUntilSatisfied(); |
| 650 | 650 |
| 651 ASSERT_EQ(1u, notification_manager()->GetNotificationCount()); | 651 ASSERT_EQ(1u, notification_manager()->GetNotificationCount()); |
| 652 EXPECT_EQ(base::ASCIIToUTF16("push_test_tag"), | 652 EXPECT_EQ(base::ASCIIToUTF16("push_test_tag"), |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 } | 713 } |
| 714 | 714 |
| 715 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnregisterSuccess) { | 715 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnregisterSuccess) { |
| 716 if (!IsPushSupported()) | 716 if (!IsPushSupported()) |
| 717 return; | 717 return; |
| 718 | 718 |
| 719 std::string script_result; | 719 std::string script_result; |
| 720 | 720 |
| 721 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); | 721 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); |
| 722 | 722 |
| 723 gcm_service()->AddExpectedUnregisterResponse(GCMClient::SUCCESS); | 723 gcm_service()->AddExpectedUnregisterResponse(gcm::GCMClient::SUCCESS); |
| 724 | 724 |
| 725 ASSERT_TRUE(RunScript("unregister()", &script_result)); | 725 ASSERT_TRUE(RunScript("unregister()", &script_result)); |
| 726 EXPECT_EQ("unregister result: true", script_result); | 726 EXPECT_EQ("unregister result: true", script_result); |
| 727 } | 727 } |
| 728 | 728 |
| 729 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnregisterNetworkError) { | 729 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnregisterNetworkError) { |
| 730 if (!IsPushSupported()) | 730 if (!IsPushSupported()) |
| 731 return; | 731 return; |
| 732 | 732 |
| 733 std::string script_result; | 733 std::string script_result; |
| 734 | 734 |
| 735 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); | 735 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); |
| 736 | 736 |
| 737 gcm_service()->AddExpectedUnregisterResponse(GCMClient::NETWORK_ERROR); | 737 gcm_service()->AddExpectedUnregisterResponse(gcm::GCMClient::NETWORK_ERROR); |
| 738 | 738 |
| 739 ASSERT_TRUE(RunScript("unregister()", &script_result)); | 739 ASSERT_TRUE(RunScript("unregister()", &script_result)); |
| 740 EXPECT_EQ("unregister error: NetworkError: " | 740 EXPECT_EQ("unregister error: NetworkError: " |
| 741 "Unregistration failed - could not connect to push server", | 741 "Unregistration failed - could not connect to push server", |
| 742 script_result); | 742 script_result); |
| 743 } | 743 } |
| 744 | 744 |
| 745 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnregisterAbortError) { | 745 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, UnregisterAbortError) { |
| 746 if (!IsPushSupported()) | 746 if (!IsPushSupported()) |
| 747 return; | 747 return; |
| 748 | 748 |
| 749 std::string script_result; | 749 std::string script_result; |
| 750 | 750 |
| 751 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); | 751 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); |
| 752 | 752 |
| 753 gcm_service()->AddExpectedUnregisterResponse(GCMClient::UNKNOWN_ERROR); | 753 gcm_service()->AddExpectedUnregisterResponse(gcm::GCMClient::UNKNOWN_ERROR); |
| 754 | 754 |
| 755 ASSERT_TRUE(RunScript("unregister()", &script_result)); | 755 ASSERT_TRUE(RunScript("unregister()", &script_result)); |
| 756 EXPECT_EQ("unregister error: " | 756 EXPECT_EQ("unregister error: " |
| 757 "AbortError: Unregistration failed - push service error", | 757 "AbortError: Unregistration failed - push service error", |
| 758 script_result); | 758 script_result); |
| 759 } | 759 } |
| 760 | 760 |
| 761 #if defined(OS_ANDROID) | 761 #if defined(OS_ANDROID) |
| 762 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PushUnavailableOnAndroidICS) { | 762 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PushUnavailableOnAndroidICS) { |
| 763 // This test should only run on Android ICS to confirm that the Push API | 763 // This test should only run on Android ICS to confirm that the Push API |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 // if the rules it used to have have been reset. | 1002 // if the rules it used to have have been reset. |
| 1003 // The Push service should not unsubcribe |origin| because at no point it was | 1003 // The Push service should not unsubcribe |origin| because at no point it was |
| 1004 // left without permission to use Push. | 1004 // left without permission to use Push. |
| 1005 | 1005 |
| 1006 ASSERT_TRUE(RunScript("hasPermission()", &script_result)); | 1006 ASSERT_TRUE(RunScript("hasPermission()", &script_result)); |
| 1007 EXPECT_EQ("permission status - granted", script_result); | 1007 EXPECT_EQ("permission status - granted", script_result); |
| 1008 | 1008 |
| 1009 ASSERT_TRUE(RunScript("hasRegistration()", &script_result)); | 1009 ASSERT_TRUE(RunScript("hasRegistration()", &script_result)); |
| 1010 EXPECT_EQ("true - registered", script_result); | 1010 EXPECT_EQ("true - registered", script_result); |
| 1011 } | 1011 } |
| 1012 | |
| 1013 } // namespace gcm | |
| OLD | NEW |