Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // 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.
| |
| 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_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | |
| 7 | |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | |
| 9 #include "components/policy/core/common/mock_configuration_policy_provider.h" | |
| 10 | |
| 11 struct ManagementPolicyRequestLog { | |
| 12 std::string all_headers; | |
| 13 std::string host; | |
| 14 }; | |
| 15 | |
| 16 // The ExtensionSettings policy affects host permissions which impacts several | |
| 17 // API integration tests. This class enables easy declaration of | |
| 18 // ExtensionSettings policies and functions commonly used during these tests. | |
| 19 class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest { | |
| 20 public: | |
| 21 ExtensionApiTestWithManagementPolicy(); | |
| 22 ~ExtensionApiTestWithManagementPolicy() override; | |
| 23 void SetUpInProcessBrowserTestFixture() override; | |
| 24 | |
| 25 protected: | |
| 26 void MonitorRequestHandler(const net::test_server::HttpRequest& request); | |
| 27 bool BrowsedTo(const char* test_host); | |
| 28 void ClearRequestLog(); | |
| 29 policy::MockConfigurationPolicyProvider policy_provider_; | |
| 30 | |
| 31 private: | |
| 32 std::vector<ManagementPolicyRequestLog> request_log_; | |
| 33 }; | |
| 34 | |
| 35 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | |
| OLD | NEW |