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

Side by Side Diff: chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc

Issue 1078213004: Remove --check-cloud-print-connector-policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sat Apr 11 02:29:11 PDT 2015 Created 5 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
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 #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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 429
430 prefs->RemoveManagedPref(prefs::kCloudPrintProxyEnabled); 430 prefs->RemoveManagedPref(prefs::kCloudPrintProxyEnabled);
431 EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail)); 431 EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail));
432 432
433 service.GetMockServiceProcessControl()->SetWillBeEnabledExpectations(); 433 service.GetMockServiceProcessControl()->SetWillBeEnabledExpectations();
434 service.EnableForUser(); 434 service.EnableForUser();
435 435
436 EXPECT_EQ(MockServiceProcessControl::EnabledUserId(), 436 EXPECT_EQ(MockServiceProcessControl::EnabledUserId(),
437 prefs->GetString(prefs::kCloudPrintEmail)); 437 prefs->GetString(prefs::kCloudPrintEmail));
438 } 438 }
439
440 KeyedService* TestCloudPrintProxyServiceFactory(
441 content::BrowserContext* profile) {
442 TestCloudPrintProxyService* service =
443 new TestCloudPrintProxyService(static_cast<Profile*>(profile));
444
445 service->GetMockServiceProcessControl()->SetConnectSuccessMockExpectations(
446 MockServiceProcessControl::kServiceStateEnabled, true);
447 service->GetMockServiceProcessControl()->SetWillBeDisabledExpectations();
448
449 service->Initialize();
450 return service;
451 }
452
453 TEST_F(CloudPrintProxyPolicyTest, StartupBrowserCreatorWithCommandLine) {
454 TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService();
455 prefs->SetUserPref(prefs::kCloudPrintEmail,
456 new base::StringValue(std::string()));
457 prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
458 new base::FundamentalValue(false));
459
460 CloudPrintProxyServiceFactory::GetInstance()->
461 SetTestingFactory(&profile_, TestCloudPrintProxyServiceFactory);
462
463 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
464 command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy);
465
466 EXPECT_FALSE(LaunchBrowser(command_line, &profile_));
467 base::RunLoop().RunUntilIdle();
468 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698