| 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 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 MockServiceProcessControl process_control_; | 200 MockServiceProcessControl process_control_; |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 class CloudPrintProxyPolicyTest : public ::testing::Test { | 203 class CloudPrintProxyPolicyTest : public ::testing::Test { |
| 204 public: | 204 public: |
| 205 CloudPrintProxyPolicyTest() | 205 CloudPrintProxyPolicyTest() |
| 206 : ui_thread_(content::BrowserThread::UI, &message_loop_) { | 206 : ui_thread_(content::BrowserThread::UI, &message_loop_) { |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool LaunchBrowser(const base::CommandLine& command_line, Profile* profile) { | 209 bool LaunchBrowser(const base::CommandLine& command_line, Profile* profile) { |
| 210 int return_code = 0; | |
| 211 StartupBrowserCreator browser_creator; | 210 StartupBrowserCreator browser_creator; |
| 212 return StartupBrowserCreator::ProcessCmdLineImpl( | 211 return StartupBrowserCreator::ProcessCmdLineImpl( |
| 213 command_line, base::FilePath(), false, profile, | 212 command_line, base::FilePath(), false, profile, |
| 214 StartupBrowserCreator::Profiles(), &return_code, &browser_creator); | 213 StartupBrowserCreator::Profiles(), &browser_creator); |
| 215 } | 214 } |
| 216 | 215 |
| 217 protected: | 216 protected: |
| 218 base::MessageLoopForUI message_loop_; | 217 base::MessageLoopForUI message_loop_; |
| 219 content::TestBrowserThread ui_thread_; | 218 content::TestBrowserThread ui_thread_; |
| 220 TestingProfile profile_; | 219 TestingProfile profile_; |
| 221 }; | 220 }; |
| 222 | 221 |
| 223 TEST_F(CloudPrintProxyPolicyTest, VerifyExpectations) { | 222 TEST_F(CloudPrintProxyPolicyTest, VerifyExpectations) { |
| 224 MockServiceProcessControl mock_control; | 223 MockServiceProcessControl mock_control; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 459 |
| 461 CloudPrintProxyServiceFactory::GetInstance()-> | 460 CloudPrintProxyServiceFactory::GetInstance()-> |
| 462 SetTestingFactory(&profile_, TestCloudPrintProxyServiceFactory); | 461 SetTestingFactory(&profile_, TestCloudPrintProxyServiceFactory); |
| 463 | 462 |
| 464 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 463 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
| 465 command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); | 464 command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); |
| 466 | 465 |
| 467 EXPECT_FALSE(LaunchBrowser(command_line, &profile_)); | 466 EXPECT_FALSE(LaunchBrowser(command_line, &profile_)); |
| 468 base::RunLoop().RunUntilIdle(); | 467 base::RunLoop().RunUntilIdle(); |
| 469 } | 468 } |
| OLD | NEW |