OLD | NEW |
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 void ShutdownAndWaitForExitWithTimeout(base::Process process); | 315 void ShutdownAndWaitForExitWithTimeout(base::Process process); |
316 | 316 |
317 // IPC::Listener implementation | 317 // IPC::Listener implementation |
318 bool OnMessageReceived(const IPC::Message& message) override { return false; } | 318 bool OnMessageReceived(const IPC::Message& message) override { return false; } |
319 void OnChannelConnected(int32 peer_pid) override; | 319 void OnChannelConnected(int32 peer_pid) override; |
320 | 320 |
321 // MultiProcessTest implementation. | 321 // MultiProcessTest implementation. |
322 base::CommandLine MakeCmdLine(const std::string& procname) override; | 322 base::CommandLine MakeCmdLine(const std::string& procname) override; |
323 | 323 |
324 bool LaunchBrowser(const base::CommandLine& command_line, Profile* profile) { | 324 bool LaunchBrowser(const base::CommandLine& command_line, Profile* profile) { |
325 int return_code = 0; | |
326 StartupBrowserCreator browser_creator; | 325 StartupBrowserCreator browser_creator; |
327 return StartupBrowserCreator::ProcessCmdLineImpl( | 326 return StartupBrowserCreator::ProcessCmdLineImpl( |
328 command_line, base::FilePath(), false, profile, | 327 command_line, base::FilePath(), false, profile, |
329 StartupBrowserCreator::Profiles(), &return_code, &browser_creator); | 328 StartupBrowserCreator::Profiles(), &browser_creator); |
330 } | 329 } |
331 | 330 |
332 protected: | 331 protected: |
333 content::TestBrowserThreadBundle thread_bundle_; | 332 content::TestBrowserThreadBundle thread_bundle_; |
334 base::ScopedTempDir temp_user_data_dir_; | 333 base::ScopedTempDir temp_user_data_dir_; |
335 | 334 |
336 std::string startup_channel_id_; | 335 std::string startup_channel_id_; |
337 scoped_ptr<IPC::ChannelProxy> startup_channel_; | 336 scoped_ptr<IPC::ChannelProxy> startup_channel_; |
338 scoped_ptr<ChromeContentClient> content_client_; | 337 scoped_ptr<ChromeContentClient> content_client_; |
339 scoped_ptr<chrome::ChromeContentBrowserClient> browser_content_client_; | 338 scoped_ptr<chrome::ChromeContentBrowserClient> browser_content_client_; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 // condition. | 617 // condition. |
619 if (should_run_loop) | 618 if (should_run_loop) |
620 run_loop.Run(); | 619 run_loop.Run(); |
621 | 620 |
622 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); | 621 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); |
623 | 622 |
624 ShutdownAndWaitForExitWithTimeout(process.Pass()); | 623 ShutdownAndWaitForExitWithTimeout(process.Pass()); |
625 content::RunAllPendingInMessageLoop(); | 624 content::RunAllPendingInMessageLoop(); |
626 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); | 625 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); |
627 } | 626 } |
OLD | NEW |