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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 | « chrome/browser/prefs/pref_value_store.cc ('k') | chrome/browser/printing/print_job_manager.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 (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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } // namespace 86 } // namespace
87 87
88 class TestServiceProcess : public ServiceProcess { 88 class TestServiceProcess : public ServiceProcess {
89 public: 89 public:
90 TestServiceProcess() { } 90 TestServiceProcess() { }
91 virtual ~TestServiceProcess() { } 91 virtual ~TestServiceProcess() { }
92 92
93 bool Initialize(MessageLoopForUI* message_loop, ServiceProcessState* state); 93 bool Initialize(MessageLoopForUI* message_loop, ServiceProcessState* state);
94 94
95 base::MessageLoopProxy* IOMessageLoopProxy() { 95 base::MessageLoopProxy* IOMessageLoopProxy() {
96 return io_thread_->message_loop_proxy(); 96 return io_thread_->message_loop_proxy().get();
97 } 97 }
98 }; 98 };
99 99
100 bool TestServiceProcess::Initialize(MessageLoopForUI* message_loop, 100 bool TestServiceProcess::Initialize(MessageLoopForUI* message_loop,
101 ServiceProcessState* state) { 101 ServiceProcessState* state) {
102 main_message_loop_ = message_loop; 102 main_message_loop_ = message_loop;
103 103
104 service_process_state_.reset(state); 104 service_process_state_.reset(state);
105 105
106 base::Thread::Options options(MessageLoop::TYPE_IO, 0); 106 base::Thread::Options options(MessageLoop::TYPE_IO, 0);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 class CloudPrintProxyPolicyStartupTest : public base::MultiProcessTest, 282 class CloudPrintProxyPolicyStartupTest : public base::MultiProcessTest,
283 public IPC::Listener { 283 public IPC::Listener {
284 public: 284 public:
285 CloudPrintProxyPolicyStartupTest(); 285 CloudPrintProxyPolicyStartupTest();
286 ~CloudPrintProxyPolicyStartupTest(); 286 ~CloudPrintProxyPolicyStartupTest();
287 287
288 virtual void SetUp(); 288 virtual void SetUp();
289 base::MessageLoopProxy* IOMessageLoopProxy() { 289 base::MessageLoopProxy* IOMessageLoopProxy() {
290 return io_thread_.message_loop_proxy(); 290 return io_thread_.message_loop_proxy().get();
291 } 291 }
292 base::ProcessHandle Launch(const std::string& name); 292 base::ProcessHandle Launch(const std::string& name);
293 void WaitForConnect(); 293 void WaitForConnect();
294 bool Send(IPC::Message* message); 294 bool Send(IPC::Message* message);
295 void ShutdownAndWaitForExitWithTimeout(base::ProcessHandle handle); 295 void ShutdownAndWaitForExitWithTimeout(base::ProcessHandle handle);
296 296
297 // IPC::Listener implementation 297 // IPC::Listener implementation
298 virtual bool OnMessageReceived(const IPC::Message& message) { return false; } 298 virtual bool OnMessageReceived(const IPC::Message& message) { return false; }
299 virtual void OnChannelConnected(int32 peer_pid); 299 virtual void OnChannelConnected(int32 peer_pid);
300 300
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 #else 399 #else
400 base::ProcessHandle handle = SpawnChild(name, false); 400 base::ProcessHandle handle = SpawnChild(name, false);
401 #endif 401 #endif
402 EXPECT_TRUE(handle); 402 EXPECT_TRUE(handle);
403 return handle; 403 return handle;
404 } 404 }
405 405
406 void CloudPrintProxyPolicyStartupTest::WaitForConnect() { 406 void CloudPrintProxyPolicyStartupTest::WaitForConnect() {
407 observer_.Wait(); 407 observer_.Wait();
408 EXPECT_TRUE(CheckServiceProcessReady()); 408 EXPECT_TRUE(CheckServiceProcessReady());
409 EXPECT_TRUE(base::MessageLoopProxy::current()); 409 EXPECT_TRUE(base::MessageLoopProxy::current().get());
410 ServiceProcessControl::GetInstance()->SetChannel(new IPC::ChannelProxy( 410 ServiceProcessControl::GetInstance()->SetChannel(new IPC::ChannelProxy(
411 GetServiceProcessChannel(), IPC::Channel::MODE_NAMED_CLIENT, 411 GetServiceProcessChannel(), IPC::Channel::MODE_NAMED_CLIENT,
412 ServiceProcessControl::GetInstance(), IOMessageLoopProxy())); 412 ServiceProcessControl::GetInstance(), IOMessageLoopProxy()));
413 } 413 }
414 414
415 bool CloudPrintProxyPolicyStartupTest::Send(IPC::Message* message) { 415 bool CloudPrintProxyPolicyStartupTest::Send(IPC::Message* message) {
416 return ServiceProcessControl::GetInstance()->Send(message); 416 return ServiceProcessControl::GetInstance()->Send(message);
417 } 417 }
418 418
419 void CloudPrintProxyPolicyStartupTest::ShutdownAndWaitForExitWithTimeout( 419 void CloudPrintProxyPolicyStartupTest::ShutdownAndWaitForExitWithTimeout(
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // No expectations on run_loop being true here; that would be a race 533 // No expectations on run_loop being true here; that would be a race
534 // condition. 534 // condition.
535 if (run_loop) 535 if (run_loop)
536 MessageLoop::current()->Run(); 536 MessageLoop::current()->Run();
537 537
538 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); 538 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail));
539 539
540 ShutdownAndWaitForExitWithTimeout(handle); 540 ShutdownAndWaitForExitWithTimeout(handle);
541 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); 541 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy");
542 } 542 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_value_store.cc ('k') | chrome/browser/printing/print_job_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698