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..d2bc9ab2acfa1fa16d6de709476c8c36306d943e |
| --- /dev/null |
| +++ b/chrome/browser/extensions/extension_with_management_policy_apitest.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| +// 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/api/permissions/permissions_api.h" |
| +#include "chrome/browser/extensions/extension_apitest.h" |
| +#include "chrome/browser/extensions/extension_management_test_util.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/ui/browser.h" |
| +#include "components/policy/core/browser/browser_policy_connector.h" |
| +#include "components/policy/core/common/mock_configuration_policy_provider.h" |
| +#include "extensions/browser/extension_prefs.h" |
| +#include "extensions/common/permissions/permission_set.h" |
| +#include "extensions/common/switches.h" |
| +#include "net/dns/mock_host_resolver.h" |
| +#include "net/test/embedded_test_server/http_request.h" |
| + |
| +namespace extensions { |
| + |
| +namespace { |
|
asargent_no_longer_on_chrome
2016/11/23 01:19:23
no anonymous namespaces in .h files
If you want t
nrpeter
2017/01/02 19:57:45
Done.
|
| + static void AddPattern(URLPatternSet* extent, const std::string& pattern); |
| +} |
| + |
| +} |
| + |
| +struct ManagementPolicyRequestLog { |
| + std::string all_headers; |
| + std::string host; |
| +}; |
| + |
| +class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest { |
|
asargent_no_longer_on_chrome
2016/11/23 01:19:23
nit: needs brief overview comment about why this c
nrpeter
2017/01/02 19:57:45
Done.
|
| + 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_; |
| +}; |
| + |
|
asargent_no_longer_on_chrome
2016/11/23 01:19:23
missing matching brace to close the extensions nam
nrpeter
2017/01/02 19:57:45
Done.
|
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_ |