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

Side by Side Diff: chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Create a service process that uses a Mock to respond to the browser in order 5 // Create a service process that uses a Mock to respond to the browser in order
6 // to test launching the browser using the cloud print policy check command 6 // to test launching the browser using the cloud print policy check command
7 // line switch. 7 // line switch.
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 449 }
450 450
451 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { 451 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) {
452 base::ProcessHandle handle = 452 base::ProcessHandle handle =
453 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); 453 Launch("CloudPrintMockService_StartEnabledWaitForQuit");
454 WaitForConnect(); 454 WaitForConnect();
455 ShutdownAndWaitForExitWithTimeout(handle); 455 ShutdownAndWaitForExitWithTimeout(handle);
456 } 456 }
457 457
458 ProfileKeyedService* CloudPrintProxyServiceFactoryForPolicyTest( 458 ProfileKeyedService* CloudPrintProxyServiceFactoryForPolicyTest(
459 Profile* profile) { 459 content::BrowserContext* profile) {
460 CloudPrintProxyService* service = new CloudPrintProxyService(profile); 460 CloudPrintProxyService* service =
461 new CloudPrintProxyService(static_cast<Profile*>(profile));
461 service->Initialize(); 462 service->Initialize();
462 return service; 463 return service;
463 } 464 }
464 465
465 TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) { 466 TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) {
466 base::ProcessHandle handle = 467 base::ProcessHandle handle =
467 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); 468 Launch("CloudPrintMockService_StartEnabledWaitForQuit");
468 469
469 TestingBrowserProcess* browser_process = 470 TestingBrowserProcess* browser_process =
470 TestingBrowserProcess::GetGlobal(); 471 TestingBrowserProcess::GetGlobal();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 // No expectations on run_loop being true here; that would be a race 538 // No expectations on run_loop being true here; that would be a race
538 // condition. 539 // condition.
539 if (run_loop) 540 if (run_loop)
540 MessageLoop::current()->Run(); 541 MessageLoop::current()->Run();
541 542
542 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); 543 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail));
543 544
544 ShutdownAndWaitForExitWithTimeout(handle); 545 ShutdownAndWaitForExitWithTimeout(handle);
545 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); 546 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy");
546 } 547 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698