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

Side by Side Diff: chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc

Issue 1348903007: Revert of Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 2015 The Chromium Authors. All rights reserved. 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 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 "base/strings/stringprintf.h" 5 #include "base/strings/stringprintf.h"
6 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 6 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
7 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" 7 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
8 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h" 8 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/net/url_request_mock_util.h" 10 #include "chrome/browser/net/url_request_mock_util.h"
11 #include "chromeos/dbus/fake_session_manager_client.h" 11 #include "chromeos/dbus/fake_session_manager_client.h"
12 #include "chromeos/login/user_names.h" 12 #include "chromeos/login/user_names.h"
13 #include "components/policy/core/common/mock_configuration_policy_provider.h" 13 #include "components/policy/core/common/mock_configuration_policy_provider.h"
14 #include "components/policy/core/common/policy_types.h"
15 #include "content/public/browser/notification_service.h" 14 #include "content/public/browser/notification_service.h"
16 #include "content/public/test/test_utils.h" 15 #include "content/public/test/test_utils.h"
17 #include "extensions/browser/api_test_utils.h" 16 #include "extensions/browser/api_test_utils.h"
18 #include "extensions/browser/extension_registry.h" 17 #include "extensions/browser/extension_registry.h"
19 #include "extensions/browser/test_extension_registry_observer.h" 18 #include "extensions/browser/test_extension_registry_observer.h"
20 #include "net/test/url_request/url_request_mock_http_job.h" 19 #include "net/test/url_request/url_request_mock_http_job.h"
21 #include "policy/policy_constants.h" 20 #include "policy/policy_constants.h"
22 21
23 namespace { 22 namespace {
24 23
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 GURL update_manifest_url( 97 GURL update_manifest_url(
99 net::URLRequestMockHTTPJob::GetMockUrl(update_manifest_path)); 98 net::URLRequestMockHTTPJob::GetMockUrl(update_manifest_path));
100 99
101 scoped_ptr<base::ListValue> forcelist(new base::ListValue); 100 scoped_ptr<base::ListValue> forcelist(new base::ListValue);
102 forcelist->AppendString(base::StringPrintf( 101 forcelist->AppendString(base::StringPrintf(
103 "%s;%s", kTestExtensionID, update_manifest_url.spec().c_str())); 102 "%s;%s", kTestExtensionID, update_manifest_url.spec().c_str()));
104 103
105 policy::PolicyMap policy; 104 policy::PolicyMap policy;
106 policy.Set(policy::key::kExtensionInstallForcelist, 105 policy.Set(policy::key::kExtensionInstallForcelist,
107 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE, 106 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE,
108 policy::POLICY_SOURCE_CLOUD, forcelist.release(), nullptr); 107 forcelist.release(), NULL);
109 108
110 // Set the policy and wait until the extension is installed. 109 // Set the policy and wait until the extension is installed.
111 extensions::TestExtensionRegistryObserver observer( 110 extensions::TestExtensionRegistryObserver observer(
112 ExtensionRegistry::Get(profile())); 111 ExtensionRegistry::Get(profile()));
113 policy_provider_.UpdateChromePolicy(policy); 112 policy_provider_.UpdateChromePolicy(policy);
114 observer.WaitForExtensionLoaded(); 113 observer.WaitForExtensionLoaded();
115 } 114 }
116 115
117 chromeos::FakeSessionManagerClient* const fake_session_manager_client_; 116 chromeos::FakeSessionManagerClient* const fake_session_manager_client_;
118 policy::MockConfigurationPolicyProvider policy_provider_; 117 policy::MockConfigurationPolicyProvider policy_provider_;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 const extensions::Extension* extension = 174 const extensions::Extension* extension =
176 GetExtensionByPath(registry->enabled_extensions(), extension_path); 175 GetExtensionByPath(registry->enabled_extensions(), extension_path);
177 ASSERT_FALSE(extension->install_warnings().empty()); 176 ASSERT_FALSE(extension->install_warnings().empty());
178 EXPECT_EQ( 177 EXPECT_EQ(
179 "'enterprise.deviceAttributes' is not allowed for specified install " 178 "'enterprise.deviceAttributes' is not allowed for specified install "
180 "location.", 179 "location.",
181 extension->install_warnings()[0].message); 180 extension->install_warnings()[0].message);
182 } 181 }
183 182
184 } // namespace extensions 183 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698