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

Side by Side Diff: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <cryptohi.h> 5 #include <cryptohi.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" 9 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
11 #include "chrome/browser/net/nss_context.h" 11 #include "chrome/browser/net/nss_context.h"
12 #include "chrome/browser/net/url_request_mock_util.h" 12 #include "chrome/browser/net/url_request_mock_util.h"
13 #include "chromeos/chromeos_switches.h" 13 #include "chromeos/chromeos_switches.h"
14 #include "chromeos/login/user_names.h" 14 #include "chromeos/login/user_names.h"
15 #include "components/policy/core/browser/browser_policy_connector.h" 15 #include "components/policy/core/browser/browser_policy_connector.h"
16 #include "components/policy/core/common/mock_configuration_policy_provider.h" 16 #include "components/policy/core/common/mock_configuration_policy_provider.h"
17 #include "components/policy/core/common/policy_map.h" 17 #include "components/policy/core/common/policy_map.h"
18 #include "components/policy/core/common/policy_types.h"
18 #include "content/public/browser/notification_service.h" 19 #include "content/public/browser/notification_service.h"
19 #include "content/public/common/content_switches.h" 20 #include "content/public/common/content_switches.h"
20 #include "content/public/test/test_utils.h" 21 #include "content/public/test/test_utils.h"
21 #include "crypto/nss_util_internal.h" 22 #include "crypto/nss_util_internal.h"
22 #include "crypto/scoped_test_system_nss_key_slot.h" 23 #include "crypto/scoped_test_system_nss_key_slot.h"
23 #include "extensions/browser/extension_registry.h" 24 #include "extensions/browser/extension_registry.h"
24 #include "extensions/browser/notification_types.h" 25 #include "extensions/browser/notification_types.h"
25 #include "net/base/net_errors.h" 26 #include "net/base/net_errors.h"
26 #include "net/cert/nss_cert_database.h" 27 #include "net/cert/nss_cert_database.h"
27 #include "net/test/url_request/url_request_mock_http_job.h" 28 #include "net/test/url_request/url_request_mock_http_job.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 net::URLRequestMockHTTPJob::GetMockUrl(update_manifest_path)); 297 net::URLRequestMockHTTPJob::GetMockUrl(update_manifest_path));
297 298
298 scoped_ptr<base::ListValue> forcelist(new base::ListValue); 299 scoped_ptr<base::ListValue> forcelist(new base::ListValue);
299 forcelist->AppendString(base::StringPrintf( 300 forcelist->AppendString(base::StringPrintf(
300 "%s;%s", kTestExtensionID, update_manifest_url.spec().c_str())); 301 "%s;%s", kTestExtensionID, update_manifest_url.spec().c_str()));
301 302
302 policy::PolicyMap policy; 303 policy::PolicyMap policy;
303 policy.Set(policy::key::kExtensionInstallForcelist, 304 policy.Set(policy::key::kExtensionInstallForcelist,
304 policy::POLICY_LEVEL_MANDATORY, 305 policy::POLICY_LEVEL_MANDATORY,
305 policy::POLICY_SCOPE_MACHINE, 306 policy::POLICY_SCOPE_MACHINE,
307 policy::POLICY_SOURCE_CLOUD,
306 forcelist.release(), 308 forcelist.release(),
307 NULL); 309 NULL);
308 310
309 // Set the policy and wait until the extension is installed. 311 // Set the policy and wait until the extension is installed.
310 content::WindowedNotificationObserver observer( 312 content::WindowedNotificationObserver observer(
311 extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED, 313 extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
312 content::NotificationService::AllSources()); 314 content::NotificationService::AllSources());
313 policy_provider_.UpdateChromePolicy(policy); 315 policy_provider_.UpdateChromePolicy(policy);
314 observer.Wait(); 316 observer.Wait();
315 } 317 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 extensions::ExtensionRegistry* registry = 378 extensions::ExtensionRegistry* registry =
377 extensions::ExtensionRegistry::Get(profile()); 379 extensions::ExtensionRegistry::Get(profile());
378 const extensions::Extension* extension = 380 const extensions::Extension* extension =
379 GetExtensionByPath(registry->enabled_extensions(), extension_path); 381 GetExtensionByPath(registry->enabled_extensions(), extension_path);
380 ASSERT_FALSE(extension->install_warnings().empty()); 382 ASSERT_FALSE(extension->install_warnings().empty());
381 EXPECT_EQ( 383 EXPECT_EQ(
382 "'enterprise.platformKeys' is not allowed for specified install " 384 "'enterprise.platformKeys' is not allowed for specified install "
383 "location.", 385 "location.",
384 extension->install_warnings()[0].message); 386 extension->install_warnings()[0].message);
385 } 387 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698