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

Unified Diff: content/browser/frame_host/data_url_navigation_browsertest.cc

Issue 2887523002: Avoid changing enabled features while the browser is already running.
Patch Set: Created 3 years, 7 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
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/data_url_navigation_browsertest.cc
diff --git a/content/browser/frame_host/data_url_navigation_browsertest.cc b/content/browser/frame_host/data_url_navigation_browsertest.cc
index d500fb2ba21fc4e4ae10719fe84c5cc29a573e72..91ef6df1878852e3d46a699c4b6c67dc1a70e086 100644
--- a/content/browser/frame_host/data_url_navigation_browsertest.cc
+++ b/content/browser/frame_host/data_url_navigation_browsertest.cc
@@ -507,13 +507,28 @@ IN_PROC_BROWSER_TEST_F(DataUrlNavigationBrowserTest, HTML_Navigation_Block) {
NAVIGATION_BLOCKED);
}
+class DataUrlNavigationAllowedFromContentTest
+ : public DataUrlNavigationBrowserTest {
+ public:
+ DataUrlNavigationAllowedFromContentTest() {}
+
+ protected:
+ void SetUp() override {
+ scoped_feature_list_.InitAndEnableFeature(
+ features::kAllowContentInitiatedDataUrlNavigations);
+ DataUrlNavigationBrowserTest::SetUp();
+ }
+
+ private:
+ base::test::ScopedFeatureList scoped_feature_list_;
+
+ DISALLOW_COPY_AND_ASSIGN(DataUrlNavigationAllowedFromContentTest);
+};
+
// Tests that a content initiated navigation to a data URL is allowed if
// blocking is disabled with a feature flag.
-IN_PROC_BROWSER_TEST_F(DataUrlNavigationBrowserTest,
- HTML_Navigation_Allow_FeatureFlag) {
- base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(
- features::kAllowContentInitiatedDataUrlNavigations);
+IN_PROC_BROWSER_TEST_F(DataUrlNavigationAllowedFromContentTest,
+ HTML_Navigation) {
NavigateToURL(shell(),
embedded_test_server()->GetURL("/data_url_navigations.html"));
ExecuteScriptAndCheckNavigation(
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698