Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | |
| 7 | |
| 8 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | |
|
Devlin
2017/01/26 22:47:39
Surely we don't need quite this many includes?
nrpeter
2017/02/03 19:32:24
Good catch, I forgot to remove these after refacto
| |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | |
| 10 #include "chrome/browser/extensions/extension_management_test_util.h" | |
| 11 #include "chrome/browser/profiles/profile.h" | |
| 12 #include "chrome/browser/ui/browser.h" | |
| 13 #include "components/policy/core/browser/browser_policy_connector.h" | |
| 14 #include "components/policy/core/common/mock_configuration_policy_provider.h" | |
| 15 #include "extensions/browser/extension_prefs.h" | |
| 16 #include "extensions/common/permissions/permission_set.h" | |
| 17 #include "extensions/common/switches.h" | |
| 18 #include "net/dns/mock_host_resolver.h" | |
| 19 #include "net/test/embedded_test_server/http_request.h" | |
| 20 | |
| 21 struct ManagementPolicyRequestLog { | |
| 22 std::string all_headers; | |
| 23 std::string host; | |
| 24 }; | |
| 25 | |
| 26 // The ExtensionSettings policy affects host permissions which impacts several | |
| 27 // API integration tests. This class enables easy declaration of | |
| 28 // ExtensionSettings policies and functions commonly used during these tests. | |
| 29 class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest { | |
| 30 public: | |
| 31 ExtensionApiTestWithManagementPolicy(); | |
| 32 ~ExtensionApiTestWithManagementPolicy() override; | |
| 33 void SetUpInProcessBrowserTestFixture() override; | |
| 34 | |
| 35 protected: | |
| 36 void MonitorRequestHandler(const net::test_server::HttpRequest& request); | |
| 37 bool BrowsedTo(const char* test_host); | |
| 38 void ClearRequestLog(); | |
| 39 policy::MockConfigurationPolicyProvider policy_provider_; | |
| 40 | |
| 41 private: | |
| 42 std::vector<ManagementPolicyRequestLog> request_log_; | |
| 43 }; | |
| 44 | |
| 45 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | |
| OLD | NEW |