Commit 77f7c83f authored by Nikita Podguzov's avatar Nikita Podguzov Committed by Commit Bot

Refactor Extension API test for policy based APIs

Move common helper functions to separate utils file.
This CL will allow not to duplicate setup code for policy based APIs tests.

Bug: 992889
Change-Id: Ie2655454199c660bcf9b9ac61b7d5c5157d6f975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792169
Commit-Queue: Nikita Podguzov <nikitapodguzov@google.com>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarAlexander Hendrich <hendrich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696883}
parent 7472cdcb
...@@ -5,15 +5,12 @@ ...@@ -5,15 +5,12 @@
#include "chrome/browser/chromeos/policy/signin_profile_extensions_policy_test_base.h" #include "chrome/browser/chromeos/policy/signin_profile_extensions_policy_test_base.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/extensions/policy_test_utils.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_paths.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
#include "components/policy/proto/chrome_device_policy.pb.h" #include "components/policy/proto/chrome_device_policy.pb.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
...@@ -36,9 +33,8 @@ void SigninProfileExtensionsPolicyTestBase::SetUpCommandLine( ...@@ -36,9 +33,8 @@ void SigninProfileExtensionsPolicyTestBase::SetUpCommandLine(
void SigninProfileExtensionsPolicyTestBase::SetUpOnMainThread() { void SigninProfileExtensionsPolicyTestBase::SetUpOnMainThread() {
DevicePolicyCrosBrowserTest::SetUpOnMainThread(); DevicePolicyCrosBrowserTest::SetUpOnMainThread();
embedded_test_server()->RegisterRequestHandler(base::BindRepeating( extensions::policy_test_utils::SetUpEmbeddedTestServer(
&SigninProfileExtensionsPolicyTestBase::InterceptMockHttp, embedded_test_server());
base::Unretained(this)));
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
} }
...@@ -56,31 +52,6 @@ void SigninProfileExtensionsPolicyTestBase::AddExtensionForForceInstallation( ...@@ -56,31 +52,6 @@ void SigninProfileExtensionsPolicyTestBase::AddExtensionForForceInstallation(
RefreshDevicePolicy(); RefreshDevicePolicy();
} }
std::unique_ptr<net::test_server::HttpResponse>
SigninProfileExtensionsPolicyTestBase::InterceptMockHttp(
const net::test_server::HttpRequest& request) {
const std::string kFileNameToIntercept = "update_manifest.xml";
if (request.GetURL().ExtractFileName() != kFileNameToIntercept)
return nullptr;
base::FilePath test_data_dir;
base::PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
// Remove the leading '/'.
std::string relative_manifest_path = request.GetURL().path().substr(1);
std::string manifest_response;
CHECK(base::ReadFileToString(test_data_dir.Append(relative_manifest_path),
&manifest_response));
base::ReplaceSubstringsAfterOffset(
&manifest_response, 0, "mock.http",
embedded_test_server()->host_port_pair().ToString());
auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->set_content_type("text/xml");
response->set_content(manifest_response);
return response;
}
Profile* SigninProfileExtensionsPolicyTestBase::GetInitialProfile() { Profile* SigninProfileExtensionsPolicyTestBase::GetInitialProfile() {
// Intentionally not using the |chromeos::ProfileHelper::GetSigninProfile| // Intentionally not using the |chromeos::ProfileHelper::GetSigninProfile|
// method here, as it performs the lazy construction of the profile, while for // method here, as it performs the lazy construction of the profile, while for
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "components/version_info/channel.h" #include "components/version_info/channel.h"
#include "extensions/common/features/feature_channel.h" #include "extensions/common/features/feature_channel.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
namespace policy { namespace policy {
// Base class for testing sign-in profile apps/extensions that are installed via // Base class for testing sign-in profile apps/extensions that are installed via
...@@ -42,12 +39,6 @@ class SigninProfileExtensionsPolicyTestBase ...@@ -42,12 +39,6 @@ class SigninProfileExtensionsPolicyTestBase
const version_info::Channel channel_; const version_info::Channel channel_;
private: private:
// Replace "mock.http" with "127.0.0.1:<port>" on "update_manifest.xml" files.
// Host resolver doesn't work here because the test file doesn't know the
// correct port number.
std::unique_ptr<net::test_server::HttpResponse> InterceptMockHttp(
const net::test_server::HttpRequest& request);
const extensions::ScopedCurrentChannel scoped_current_channel_; const extensions::ScopedCurrentChannel scoped_current_channel_;
DISALLOW_COPY_AND_ASSIGN(SigninProfileExtensionsPolicyTestBase); DISALLOW_COPY_AND_ASSIGN(SigninProfileExtensionsPolicyTestBase);
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -15,6 +14,7 @@ ...@@ -15,6 +14,7 @@
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
#include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/policy_test_utils.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h"
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "components/account_id/account_id.h" #include "components/account_id/account_id.h"
#include "components/policy/core/common/cloud/device_management_service.h" #include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h" #include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/policy_constants.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
...@@ -33,10 +32,7 @@ ...@@ -33,10 +32,7 @@
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#include "extensions/browser/api_test_utils.h" #include "extensions/browser/api_test_utils.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/test/result_catcher.h" #include "extensions/test/result_catcher.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
namespace { namespace {
...@@ -99,34 +95,6 @@ class EnterpriseDeviceAttributesTest ...@@ -99,34 +95,6 @@ class EnterpriseDeviceAttributesTest
set_chromeos_user_ = false; set_chromeos_user_ = false;
} }
// Replace "mock.http" with "127.0.0.1:<port>" on "update_manifest.xml" files.
// Host resolver doesn't work here because the test file doesn't know the
// correct port number.
std::unique_ptr<net::test_server::HttpResponse> InterceptMockHttp(
const net::test_server::HttpRequest& request) {
const std::string kFileNameToIntercept = "update_manifest.xml";
if (request.GetURL().ExtractFileName() != kFileNameToIntercept)
return nullptr;
base::FilePath test_data_dir;
base::PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
// Remove the leading '/'.
std::string relative_manifest_path = request.GetURL().path().substr(1);
std::string manifest_response;
CHECK(base::ReadFileToString(test_data_dir.Append(relative_manifest_path),
&manifest_response));
base::ReplaceSubstringsAfterOffset(
&manifest_response, 0, "mock.http",
embedded_test_server()->host_port_pair().ToString());
std::unique_ptr<net::test_server::BasicHttpResponse> response(
new net::test_server::BasicHttpResponse());
response->set_content_type("text/xml");
response->set_content(manifest_response);
return response;
}
protected: protected:
// ExtensionApiTest // ExtensionApiTest
void SetUpCommandLine(base::CommandLine* command_line) override { void SetUpCommandLine(base::CommandLine* command_line) override {
...@@ -192,29 +160,6 @@ class EnterpriseDeviceAttributesTest ...@@ -192,29 +160,6 @@ class EnterpriseDeviceAttributesTest
ExtensionApiTest::SetUpOnMainThread(); ExtensionApiTest::SetUpOnMainThread();
} }
void SetPolicy() {
// Extensions that are force-installed come from an update URL, which
// defaults to the webstore. Use a mock URL for this test with an update
// manifest that includes the crx file of the test extension.
GURL update_manifest_url(
embedded_test_server()->GetURL(kUpdateManifestPath));
std::unique_ptr<base::ListValue> forcelist(new base::ListValue);
forcelist->AppendString(base::StringPrintf(
"%s;%s", kTestExtensionID, update_manifest_url.spec().c_str()));
policy::PolicyMap policy;
policy.Set(policy::key::kExtensionInstallForcelist,
policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE,
policy::POLICY_SOURCE_CLOUD, std::move(forcelist), nullptr);
// Set the policy and wait until the extension is installed.
extensions::TestExtensionRegistryObserver observer(
ExtensionRegistry::Get(profile()));
policy_provider_.UpdateChromePolicy(policy);
observer.WaitForExtensionLoaded();
}
// Load |page_url| in |browser| and wait for PASSED or FAILED notification. // Load |page_url| in |browser| and wait for PASSED or FAILED notification.
// The functionality of this function is reduced functionality of // The functionality of this function is reduced functionality of
// RunExtensionSubtest(), but we don't use it here because it requires // RunExtensionSubtest(), but we don't use it here because it requires
...@@ -248,11 +193,12 @@ class EnterpriseDeviceAttributesTest ...@@ -248,11 +193,12 @@ class EnterpriseDeviceAttributesTest
AccountId::FromUserEmailGaiaId(kAffiliatedUserEmail, AccountId::FromUserEmailGaiaId(kAffiliatedUserEmail,
kAffiliatedUserGaiaId); kAffiliatedUserGaiaId);
policy::MockConfigurationPolicyProvider policy_provider_;
private: private:
chromeos::ScopedStubInstallAttributes test_install_attributes_{ chromeos::ScopedStubInstallAttributes test_install_attributes_{
chromeos::StubInstallAttributes::CreateCloudManaged("fake-domain", chromeos::StubInstallAttributes::CreateCloudManaged("fake-domain",
"fake-id")}; "fake-id")};
policy::MockConfigurationPolicyProvider policy_provider_;
policy::DevicePolicyCrosTestHelper test_helper_; policy::DevicePolicyCrosTestHelper test_helper_;
chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider_; chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider_;
}; };
...@@ -262,13 +208,11 @@ IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, PRE_Success) { ...@@ -262,13 +208,11 @@ IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, PRE_Success) {
} }
IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, Success) { IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, Success) {
// Setup |URLLoaderInterceptor|, which is required for force-installing the policy_test_utils::SetUpEmbeddedTestServer(embedded_test_server());
// test extension through policy.
embedded_test_server()->RegisterRequestHandler(
base::BindRepeating(&EnterpriseDeviceAttributesTest::InterceptMockHttp,
base::Unretained(this)));
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
SetPolicy(); policy_test_utils::SetExtensionInstallForcelistPolicy(
kTestExtensionID, embedded_test_server()->GetURL(kUpdateManifestPath),
profile(), &policy_provider_);
EXPECT_EQ(GetParam().affiliated, user_manager::UserManager::Get() EXPECT_EQ(GetParam().affiliated, user_manager::UserManager::Get()
->FindUser(affiliated_account_id_) ->FindUser(affiliated_account_id_)
......
...@@ -11,23 +11,18 @@ ...@@ -11,23 +11,18 @@
#include "base/path_service.h" #include "base/path_service.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "chrome/browser/extensions/api/platform_keys/platform_keys_test_base.h" #include "chrome/browser/extensions/api/platform_keys/platform_keys_test_base.h"
#include "chrome/browser/extensions/policy_test_utils.h"
#include "chrome/browser/net/nss_context.h" #include "chrome/browser/net/nss_context.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "crypto/nss_util_internal.h" #include "crypto/nss_util_internal.h"
#include "crypto/scoped_test_system_nss_key_slot.h" #include "crypto/scoped_test_system_nss_key_slot.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "net/cert/nss_cert_database.h" #include "net/cert/nss_cert_database.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -168,9 +163,7 @@ class EnterprisePlatformKeysTest ...@@ -168,9 +163,7 @@ class EnterprisePlatformKeysTest
} }
void SetUpOnMainThread() override { void SetUpOnMainThread() override {
embedded_test_server()->RegisterRequestHandler( policy_test_utils::SetUpEmbeddedTestServer(embedded_test_server());
base::BindRepeating(&EnterprisePlatformKeysTest::InterceptMockHttp,
base::Unretained(this)));
PlatformKeysTestBase::SetUpOnMainThread(); PlatformKeysTestBase::SetUpOnMainThread();
} }
...@@ -184,57 +177,7 @@ class EnterprisePlatformKeysTest ...@@ -184,57 +177,7 @@ class EnterprisePlatformKeysTest
done_callback.Run(); done_callback.Run();
} }
void SetPolicy() {
// Extensions that are force-installed come from an update URL, which
// defaults to the webstore. Use a mock URL for this test with an update
// manifest that includes the crx file of the test extension.
GURL update_manifest_url(
embedded_test_server()->GetURL(kUpdateManifestPath));
std::unique_ptr<base::ListValue> forcelist(new base::ListValue);
forcelist->AppendString(base::StringPrintf(
"%s;%s", kTestExtensionID, update_manifest_url.spec().c_str()));
policy::PolicyMap policy;
policy.Set(policy::key::kExtensionInstallForcelist,
policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE,
policy::POLICY_SOURCE_CLOUD, std::move(forcelist), nullptr);
// Set the policy and wait until the extension is installed.
TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()));
mock_policy_provider()->UpdateChromePolicy(policy);
observer.WaitForExtensionWillBeInstalled();
}
private: private:
// Replace "mock.http" with "127.0.0.1:<port>" on "update_manifest.xml" files.
// Host resolver doesn't work here because the test file doesn't know the
// correct port number.
std::unique_ptr<net::test_server::HttpResponse> InterceptMockHttp(
const net::test_server::HttpRequest& request) {
const std::string kFileNameToIntercept = "update_manifest.xml";
if (request.GetURL().ExtractFileName() != kFileNameToIntercept)
return nullptr;
base::FilePath test_data_dir;
base::PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
// Remove the leading '/'.
std::string relative_manifest_path = request.GetURL().path().substr(1);
std::string manifest_response;
CHECK(base::ReadFileToString(test_data_dir.Append(relative_manifest_path),
&manifest_response));
base::ReplaceSubstringsAfterOffset(
&manifest_response, 0, "mock.http",
embedded_test_server()->host_port_pair().ToString());
std::unique_ptr<net::test_server::BasicHttpResponse> response(
new net::test_server::BasicHttpResponse());
response->set_content_type("text/xml");
response->set_content(manifest_response);
return response;
}
void PrepareTestSystemSlotOnIO( void PrepareTestSystemSlotOnIO(
crypto::ScopedTestSystemNSSKeySlot* system_slot) override { crypto::ScopedTestSystemNSSKeySlot* system_slot) override {
// Import a private key to the system slot. The Javascript part of this // Import a private key to the system slot. The Javascript part of this
...@@ -263,7 +206,9 @@ IN_PROC_BROWSER_TEST_P(EnterprisePlatformKeysTest, Basic) { ...@@ -263,7 +206,9 @@ IN_PROC_BROWSER_TEST_P(EnterprisePlatformKeysTest, Basic) {
loop.QuitClosure())); loop.QuitClosure()));
loop.Run(); loop.Run();
} }
SetPolicy(); policy_test_utils::SetExtensionInstallForcelistPolicy(
kTestExtensionID, embedded_test_server()->GetURL(kUpdateManifestPath),
profile(), mock_policy_provider());
// By default, the system token is disabled. // By default, the system token is disabled.
std::string system_token_availability = ""; std::string system_token_availability = "";
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/policy_test_utils.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/policy_constants.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "url/gurl.h"
namespace extensions {
namespace policy_test_utils {
namespace {
constexpr char kFileNameToIntercept[] = "update_manifest.xml";
// Replace "mock.http" with "127.0.0.1:<port>" on "update_manifest.xml" files.
// Host resolver doesn't work here because the test file doesn't know the
// correct port number.
std::unique_ptr<net::test_server::HttpResponse> InterceptMockHttp(
net::EmbeddedTestServer* embedded_test_server,
const net::test_server::HttpRequest& request) {
if (request.GetURL().ExtractFileName() != kFileNameToIntercept)
return nullptr;
base::FilePath test_data_dir;
base::PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
// Remove the leading '/'.
std::string relative_manifest_path = request.GetURL().path().substr(1);
std::string manifest_response;
CHECK(base::ReadFileToString(test_data_dir.Append(relative_manifest_path),
&manifest_response));
base::ReplaceSubstringsAfterOffset(
&manifest_response, 0, "mock.http",
embedded_test_server->host_port_pair().ToString());
auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->set_content_type("text/xml");
response->set_content(manifest_response);
return response;
}
} // namespace
void SetUpEmbeddedTestServer(net::EmbeddedTestServer* embedded_test_server) {
embedded_test_server->RegisterRequestHandler(
base::BindRepeating(&InterceptMockHttp, embedded_test_server));
}
void SetExtensionInstallForcelistPolicy(
const ExtensionId& extension_id,
const GURL& update_manifest_url,
Profile* profile,
policy::MockConfigurationPolicyProvider* policy_provider) {
// Extensions that are force-installed come from an update URL, which defaults
// to the webstore. Use a mock URL for test with an update manifest that
// includes the crx file of the test extension.
base::Value forcelist(base::Value::Type::LIST);
forcelist.Append(base::StringPrintf("%s;%s", extension_id.c_str(),
update_manifest_url.spec().c_str()));
policy::PolicyMap policy;
policy.Set(policy::key::kExtensionInstallForcelist,
policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE,
policy::POLICY_SOURCE_CLOUD,
base::Value::ToUniquePtrValue(std::move(forcelist)), nullptr);
// Set the policy and wait until the extension is installed.
extensions::TestExtensionRegistryObserver observer(
ExtensionRegistry::Get(profile));
policy_provider->UpdateChromePolicy(policy);
observer.WaitForExtensionLoaded();
}
} // namespace policy_test_utils
} // namespace extensions
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_POLICY_TEST_UTILS_H_
#define CHROME_BROWSER_EXTENSIONS_POLICY_TEST_UTILS_H_
#include "extensions/common/extension_id.h"
class GURL;
class Profile;
namespace net {
namespace test_server {
class EmbeddedTestServer;
} // namespace test_server
} // namespace net
namespace policy {
class MockConfigurationPolicyProvider;
} // namespace policy
namespace extensions {
namespace policy_test_utils {
// Intercepts "update_manifest.xml" files requests.
void SetUpEmbeddedTestServer(
net::test_server::EmbeddedTestServer* embedded_test_server);
// Assigns an |extension_id| and its |update_manifest_url| to the
// "ExtensionInstallForcelist" user policy.
// This will cause the extension to get force-installed.
void SetExtensionInstallForcelistPolicy(
const ExtensionId& extension_id,
const GURL& update_manifest_url,
Profile* profile,
policy::MockConfigurationPolicyProvider* policy_provider);
} // namespace policy_test_utils
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_POLICY_TEST_UTILS_H_
...@@ -296,6 +296,8 @@ static_library("test_support") { ...@@ -296,6 +296,8 @@ static_library("test_support") {
"../browser/chromeos/settings/scoped_cros_settings_test_helper.h", "../browser/chromeos/settings/scoped_cros_settings_test_helper.h",
"../browser/component_updater/fake_cros_component_manager.cc", "../browser/component_updater/fake_cros_component_manager.cc",
"../browser/component_updater/fake_cros_component_manager.h", "../browser/component_updater/fake_cros_component_manager.h",
"../browser/extensions/policy_test_utils.cc",
"../browser/extensions/policy_test_utils.h",
"../browser/ui/ash/accessibility/fake_accessibility_controller.cc", "../browser/ui/ash/accessibility/fake_accessibility_controller.cc",
"../browser/ui/ash/accessibility/fake_accessibility_controller.h", "../browser/ui/ash/accessibility/fake_accessibility_controller.h",
"base/browser_process_platform_part_test_api_chromeos.cc", "base/browser_process_platform_part_test_api_chromeos.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment