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

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

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: Fix effective TLD wildcard bug, move to Leaky LazyInstance in PermissionsData, removed unnecessary … Created 3 years, 9 months 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..56649007c3b306967a896856b683f595c8c3c38f
--- /dev/null
+++ b/chrome/browser/extensions/extension_with_management_policy_apitest.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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/extension_apitest.h"
+#include "components/policy/core/common/mock_configuration_policy_provider.h"
+
+struct ManagementPolicyRequestLog {
Devlin 2017/03/29 21:36:49 Any reason this can't be a nested struct in Extens
nrpeter 2017/03/30 00:06:06 Done.
+ std::string all_headers;
Devlin 2017/03/29 21:36:49 iwyu string
nrpeter 2017/03/30 00:06:06 Done.
+ 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);
Devlin 2017/03/29 21:36:50 Are these methods needed?
nrpeter 2017/03/30 00:06:06 Since I removed the redundant test they are no lon
Devlin 2017/03/30 00:33:53 It's usually preferable to only add stuff as we ne
nrpeter 2017/03/31 21:43:35 Done.
+ void ClearRequestLog();
+ policy::MockConfigurationPolicyProvider policy_provider_;
+
+ private:
+ std::vector<ManagementPolicyRequestLog> request_log_;
Devlin 2017/03/29 21:36:49 iwyu vector
nrpeter 2017/03/30 00:06:06 Done.
+};
Devlin 2017/03/29 21:36:49 DISALLOW_COPY_AND_ASSIGN
nrpeter 2017/03/30 00:06:06 Done.
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_

Powered by Google App Engine
This is Rietveld 408576698