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

Side by Side Diff: chrome/browser/services/gcm/push_messaging_browsertest.cc

Issue 884093003: Propagate push command line flag to the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698