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

Side by Side Diff: chrome/browser/policy/policy_startup_browsertest.cc

Issue 927163002: Now command line flag does not beat Policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test for chromeos and rebase 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Warning: this file will not be compiled for ChromeOS because the test
6 // PolicyMakeDefaultBrowserTest is not valid for this platform.
7
8 #include "base/command_line.h"
9 #include "chrome/common/chrome_result_codes.h"
10 #include "chrome/common/chrome_switches.h"
11 #include "chrome/test/base/in_process_browser_test.h"
12 #include "components/policy/core/browser/browser_policy_connector.h"
13 #include "components/policy/core/common/mock_configuration_policy_provider.h"
14 #include "components/policy/core/common/policy_map.h"
15 #include "policy/policy_constants.h"
16
17 class PolicyMakeDefaultBrowserTest : public InProcessBrowserTest {
18 protected:
19 PolicyMakeDefaultBrowserTest() : InProcessBrowserTest() {
20 set_expected_exit_code(chrome::RESULT_CODE_ACTION_DISALLOWED_BY_POLICY);
21 }
22
23 void SetUpInProcessBrowserTestFixture() override {
24 base::CommandLine::ForCurrentProcess()->AppendSwitch(
25 switches::kMakeDefaultBrowser);
26 EXPECT_CALL(provider_, IsInitializationComplete(testing::_))
27 .WillRepeatedly(testing::Return(true));
28
29 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
30
31 policy::PolicyMap values;
32 values.Set(policy::key::kDefaultBrowserSettingEnabled,
33 policy::POLICY_LEVEL_MANDATORY,
34 policy::POLICY_SCOPE_MACHINE,
35 new base::FundamentalValue(false),
36 NULL);
37 provider_.UpdateChromePolicy(values);
38 }
39
40 private:
41 policy::MockConfigurationPolicyProvider provider_;
42 DISALLOW_COPY_AND_ASSIGN(PolicyMakeDefaultBrowserTest);
43 };
44
45 IN_PROC_BROWSER_TEST_F(PolicyMakeDefaultBrowserTest, MakeDefaultDisabled) {
46 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698