Nikita Podguzov | 77f7c83 | 2019-09-16 18:48:09 | [diff] [blame] | 1 | // Copyright 2019 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 | #ifndef CHROME_BROWSER_EXTENSIONS_POLICY_TEST_UTILS_H_ |
| 6 | #define CHROME_BROWSER_EXTENSIONS_POLICY_TEST_UTILS_H_ |
| 7 | |
| 8 | #include "extensions/common/extension_id.h" |
| 9 | |
| 10 | class GURL; |
| 11 | class Profile; |
| 12 | |
| 13 | namespace net { |
| 14 | namespace test_server { |
| 15 | class EmbeddedTestServer; |
| 16 | } // namespace test_server |
| 17 | } // namespace net |
| 18 | |
| 19 | namespace policy { |
| 20 | class MockConfigurationPolicyProvider; |
| 21 | } // namespace policy |
| 22 | |
| 23 | namespace extensions { |
| 24 | |
| 25 | namespace policy_test_utils { |
| 26 | |
| 27 | // Intercepts "update_manifest.xml" files requests. |
| 28 | void SetUpEmbeddedTestServer( |
| 29 | net::test_server::EmbeddedTestServer* embedded_test_server); |
| 30 | |
| 31 | // Assigns an |extension_id| and its |update_manifest_url| to the |
| 32 | // "ExtensionInstallForcelist" user policy. |
| 33 | // This will cause the extension to get force-installed. |
| 34 | void SetExtensionInstallForcelistPolicy( |
| 35 | const ExtensionId& extension_id, |
| 36 | const GURL& update_manifest_url, |
| 37 | Profile* profile, |
| 38 | policy::MockConfigurationPolicyProvider* policy_provider); |
| 39 | |
| 40 | } // namespace policy_test_utils |
| 41 | |
| 42 | } // namespace extensions |
| 43 | |
| 44 | #endif // CHROME_BROWSER_EXTENSIONS_POLICY_TEST_UTILS_H_ |