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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 private: | 199 private: |
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 CommandLine& command_line, Profile* profile) { | 209 bool LaunchBrowser(const base::CommandLine& command_line, Profile* profile) { |
210 int return_code = 0; | 210 int return_code = 0; |
211 StartupBrowserCreator browser_creator; | 211 StartupBrowserCreator browser_creator; |
212 return StartupBrowserCreator::ProcessCmdLineImpl( | 212 return StartupBrowserCreator::ProcessCmdLineImpl( |
213 command_line, base::FilePath(), false, profile, | 213 command_line, base::FilePath(), false, profile, |
214 StartupBrowserCreator::Profiles(), &return_code, &browser_creator); | 214 StartupBrowserCreator::Profiles(), &return_code, &browser_creator); |
215 } | 215 } |
216 | 216 |
217 protected: | 217 protected: |
218 base::MessageLoopForUI message_loop_; | 218 base::MessageLoopForUI message_loop_; |
219 content::TestBrowserThread ui_thread_; | 219 content::TestBrowserThread ui_thread_; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 TEST_F(CloudPrintProxyPolicyTest, StartupBrowserCreatorWithCommandLine) { | 454 TEST_F(CloudPrintProxyPolicyTest, StartupBrowserCreatorWithCommandLine) { |
455 TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); | 455 TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); |
456 prefs->SetUserPref(prefs::kCloudPrintEmail, | 456 prefs->SetUserPref(prefs::kCloudPrintEmail, |
457 new base::StringValue(std::string())); | 457 new base::StringValue(std::string())); |
458 prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, | 458 prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, |
459 new base::FundamentalValue(false)); | 459 new base::FundamentalValue(false)); |
460 | 460 |
461 CloudPrintProxyServiceFactory::GetInstance()-> | 461 CloudPrintProxyServiceFactory::GetInstance()-> |
462 SetTestingFactory(&profile_, TestCloudPrintProxyServiceFactory); | 462 SetTestingFactory(&profile_, TestCloudPrintProxyServiceFactory); |
463 | 463 |
464 CommandLine command_line(CommandLine::NO_PROGRAM); | 464 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
465 command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); | 465 command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); |
466 | 466 |
467 EXPECT_FALSE(LaunchBrowser(command_line, &profile_)); | 467 EXPECT_FALSE(LaunchBrowser(command_line, &profile_)); |
468 base::RunLoop().RunUntilIdle(); | 468 base::RunLoop().RunUntilIdle(); |
469 } | 469 } |
OLD | NEW |