| 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" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 LoadTestPage("files/push_messaging/subscope2/test.html"); | 356 LoadTestPage("files/push_messaging/subscope2/test.html"); |
| 357 TryToRegisterSuccessfully("1-1" /* expected_push_registration_id */); | 357 TryToRegisterSuccessfully("1-1" /* expected_push_registration_id */); |
| 358 EXPECT_EQ(app_id_sw1.ToString(), gcm_service()->last_registered_app_id()); | 358 EXPECT_EQ(app_id_sw1.ToString(), gcm_service()->last_registered_app_id()); |
| 359 | 359 |
| 360 LoadTestPage(); | 360 LoadTestPage(); |
| 361 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); | 361 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); |
| 362 EXPECT_EQ(app_id_sw1.ToString(), gcm_service()->last_registered_app_id()); | 362 EXPECT_EQ(app_id_sw1.ToString(), gcm_service()->last_registered_app_id()); |
| 363 } | 363 } |
| 364 | 364 |
| 365 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, PushEventSuccess) { | 365 // Disabled due to failures: crbug.com/452666 |
| 366 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, DISABLED_PushEventSuccess) { |
| 366 std::string script_result; | 367 std::string script_result; |
| 367 | 368 |
| 368 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); | 369 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); |
| 369 | 370 |
| 370 PushMessagingApplicationId app_id(https_server()->GetURL(""), 0LL); | 371 PushMessagingApplicationId app_id(https_server()->GetURL(""), 0LL); |
| 371 EXPECT_EQ(app_id.ToString(), gcm_service()->last_registered_app_id()); | 372 EXPECT_EQ(app_id.ToString(), gcm_service()->last_registered_app_id()); |
| 372 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); | 373 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); |
| 373 | 374 |
| 374 ASSERT_TRUE(RunScript("isControlled()", &script_result)); | 375 ASSERT_TRUE(RunScript("isControlled()", &script_result)); |
| 375 ASSERT_EQ("false - is not controlled", script_result); | 376 ASSERT_EQ("false - is not controlled", script_result); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 459 |
| 459 callback.WaitUntilSatisfied(); | 460 callback.WaitUntilSatisfied(); |
| 460 EXPECT_EQ(app_id.ToString(), callback.app_id()); | 461 EXPECT_EQ(app_id.ToString(), callback.app_id()); |
| 461 | 462 |
| 462 // No push data should have been received. | 463 // No push data should have been received. |
| 463 ASSERT_TRUE(RunScript("resultQueue.popImmediately()", &script_result)); | 464 ASSERT_TRUE(RunScript("resultQueue.popImmediately()", &script_result)); |
| 464 EXPECT_EQ("null", script_result); | 465 EXPECT_EQ("null", script_result); |
| 465 } | 466 } |
| 466 | 467 |
| 467 #if defined(ENABLE_NOTIFICATIONS) | 468 #if defined(ENABLE_NOTIFICATIONS) |
| 469 // Disabled due to failures: crbug.com/452666 |
| 468 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, | 470 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, |
| 469 PushEventEnforcesUserVisibleNotification) { | 471 DISABLED_PushEventEnforcesUserVisibleNotification) { |
| 470 std::string script_result; | 472 std::string script_result; |
| 471 | 473 |
| 472 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); | 474 TryToRegisterSuccessfully("1-0" /* expected_push_registration_id */); |
| 473 | 475 |
| 474 PushMessagingApplicationId app_id(https_server()->GetURL(""), 0LL); | 476 PushMessagingApplicationId app_id(https_server()->GetURL(""), 0LL); |
| 475 EXPECT_EQ(app_id.ToString(), gcm_service()->last_registered_app_id()); | 477 EXPECT_EQ(app_id.ToString(), gcm_service()->last_registered_app_id()); |
| 476 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); | 478 EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]); |
| 477 | 479 |
| 478 ASSERT_TRUE(RunScript("isControlled()", &script_result)); | 480 ASSERT_TRUE(RunScript("isControlled()", &script_result)); |
| 479 ASSERT_EQ("false - is not controlled", script_result); | 481 ASSERT_EQ("false - is not controlled", script_result); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 598 |
| 597 gcm_service()->AddExpectedUnregisterResponse(GCMClient::UNKNOWN_ERROR); | 599 gcm_service()->AddExpectedUnregisterResponse(GCMClient::UNKNOWN_ERROR); |
| 598 | 600 |
| 599 ASSERT_TRUE(RunScript("unregister()", &script_result)); | 601 ASSERT_TRUE(RunScript("unregister()", &script_result)); |
| 600 EXPECT_EQ("unregister error: " | 602 EXPECT_EQ("unregister error: " |
| 601 "UnknownError: Unexpected error while trying to unregister from the" | 603 "UnknownError: Unexpected error while trying to unregister from the" |
| 602 " push server.", script_result); | 604 " push server.", script_result); |
| 603 } | 605 } |
| 604 | 606 |
| 605 } // namespace gcm | 607 } // namespace gcm |
| OLD | NEW |