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