Chromium Code Reviews| Index: chrome/browser/extensions/extension_with_management_policy_apitest.h |
| diff --git a/chrome/browser/extensions/extension_with_management_policy_apitest.h b/chrome/browser/extensions/extension_with_management_policy_apitest.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e40f044494d7e77900849b626df7987e83cbbbe1 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/extension_with_management_policy_apitest.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
Devlin
2017/02/14 23:17:09
not 2016 anymore
nrpeter
2017/03/22 23:47:38
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ |
| + |
| +#include "chrome/browser/extensions/extension_apitest.h" |
| +#include "components/policy/core/common/mock_configuration_policy_provider.h" |
| + |
| +struct ManagementPolicyRequestLog { |
| + std::string all_headers; |
| + std::string host; |
| +}; |
| + |
| +// The ExtensionSettings policy affects host permissions which impacts several |
| +// API integration tests. This class enables easy declaration of |
| +// ExtensionSettings policies and functions commonly used during these tests. |
| +class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest { |
| + public: |
| + ExtensionApiTestWithManagementPolicy(); |
| + ~ExtensionApiTestWithManagementPolicy() override; |
| + void SetUpInProcessBrowserTestFixture() override; |
| + |
| + protected: |
| + void MonitorRequestHandler(const net::test_server::HttpRequest& request); |
| + bool BrowsedTo(const char* test_host); |
| + void ClearRequestLog(); |
| + policy::MockConfigurationPolicyProvider policy_provider_; |
| + |
| + private: |
| + std::vector<ManagementPolicyRequestLog> request_log_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ |