Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: chrome/browser/extensions/extension_with_management_policy_apitest.h

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: URLPatternSets use shared memory for IPC. Default scope patterns sent once per renderer. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..6d9aefd08fc395754b8912c615dde508e2d4ec72
--- /dev/null
+++ b/chrome/browser/extensions/extension_with_management_policy_apitest.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
zmin 2016/12/22 22:15:39 no (c) https://chromium.googlesource.com/chromium
nrpeter 2017/01/19 01:50:44 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/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"
+
+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_

Powered by Google App Engine
This is Rietveld 408576698