OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | |
Devlin
2017/06/01 15:21:33
needed?
nrpeter
2017/06/06 21:42:07
Done.
| |
11 #include "chrome/browser/extensions/extension_apitest.h" | 12 #include "chrome/browser/extensions/extension_apitest.h" |
13 #include "chrome/browser/extensions/extension_management_test_util.h" | |
12 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 14 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
13 | 15 |
16 struct ManagementPolicyRequestLog { | |
17 std::string all_headers; | |
18 std::string host; | |
19 }; | |
20 | |
14 // The ExtensionSettings policy affects host permissions which impacts several | 21 // The ExtensionSettings policy affects host permissions which impacts several |
15 // API integration tests. This class enables easy declaration of | 22 // API integration tests. This class enables easy declaration of |
16 // ExtensionSettings policies and functions commonly used during these tests. | 23 // ExtensionSettings policies and functions commonly used during these tests. |
17 class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest { | 24 class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest { |
18 public: | 25 public: |
19 ExtensionApiTestWithManagementPolicy(); | 26 ExtensionApiTestWithManagementPolicy(); |
20 ~ExtensionApiTestWithManagementPolicy() override; | 27 ~ExtensionApiTestWithManagementPolicy() override; |
21 void SetUpInProcessBrowserTestFixture() override; | 28 void SetUpInProcessBrowserTestFixture() override; |
22 void SetUpOnMainThread() override; | 29 void SetUpOnMainThread() override; |
23 | 30 |
24 protected: | 31 protected: |
25 policy::MockConfigurationPolicyProvider policy_provider_; | 32 policy::MockConfigurationPolicyProvider policy_provider_; |
33 bool BrowsedTo(const std::string& test_host); | |
34 void ClearRequestLog(); | |
35 void MonitorRequestHandler(const net::test_server::HttpRequest& request); | |
36 | |
37 private: | |
38 std::vector<ManagementPolicyRequestLog> request_log_; | |
26 | 39 |
27 DISALLOW_COPY_AND_ASSIGN(ExtensionApiTestWithManagementPolicy); | 40 DISALLOW_COPY_AND_ASSIGN(ExtensionApiTestWithManagementPolicy); |
28 }; | 41 }; |
29 | 42 |
30 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ | 43 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ |
OLD | NEW |