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

Side by Side Diff: chrome/browser/task_manager/providers/web_contents/subframe_task_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 unified diff | Download patch
« no previous file with comments | « base/feature_list.cc ('k') | chrome/browser/ui/extensions/hosted_app_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/scoped_feature_list.h" 8 #include "base/test/scoped_feature_list.h"
9 #include "chrome/browser/task_manager/mock_web_contents_task_manager.h" 9 #include "chrome/browser/task_manager/mock_web_contents_task_manager.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 unresponsive_task == subframe_task_2); 199 unresponsive_task == subframe_task_2);
200 } 200 }
201 201
202 // A test for top document isolation and how subframes show up in the task 202 // A test for top document isolation and how subframes show up in the task
203 // manager as SubframeTasks. 203 // manager as SubframeTasks.
204 class SubframeTaskTDIBrowserTest : public InProcessBrowserTest { 204 class SubframeTaskTDIBrowserTest : public InProcessBrowserTest {
205 public: 205 public:
206 SubframeTaskTDIBrowserTest() {} 206 SubframeTaskTDIBrowserTest() {}
207 ~SubframeTaskTDIBrowserTest() override {} 207 ~SubframeTaskTDIBrowserTest() override {}
208 208
209 void SetUp() override {
210 scoped_feature_list_.InitAndEnableFeature(features::kTopDocumentIsolation);
211 InProcessBrowserTest::SetUp();
212 }
213
209 void SetUpOnMainThread() override { 214 void SetUpOnMainThread() override {
210 scoped_feature_list_.InitAndEnableFeature(features::kTopDocumentIsolation);
211 host_resolver()->AddRule("*", "127.0.0.1"); 215 host_resolver()->AddRule("*", "127.0.0.1");
212 ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); 216 ASSERT_TRUE(embedded_test_server()->InitializeAndListen());
213 content::SetupCrossSiteRedirector(embedded_test_server()); 217 content::SetupCrossSiteRedirector(embedded_test_server());
214 embedded_test_server()->StartAcceptingConnections(); 218 embedded_test_server()->StartAcceptingConnections();
215 } 219 }
216 220
217 void NavigateTo(const char* page_url) const { 221 void NavigateTo(const char* page_url) const {
218 ui_test_utils::NavigateToURL(browser(), 222 ui_test_utils::NavigateToURL(browser(),
219 embedded_test_server()->GetURL(page_url)); 223 embedded_test_server()->GetURL(page_url));
220 } 224 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 base::UTF8ToUTF16(new_title)); 270 base::UTF8ToUTF16(new_title));
267 EXPECT_TRUE(ExecuteScript(web_contents, script)); 271 EXPECT_TRUE(ExecuteScript(web_contents, script));
268 base::string16 actual_title = title_watcher.WaitAndGetTitle(); 272 base::string16 actual_title = title_watcher.WaitAndGetTitle();
269 EXPECT_EQ(new_title, base::UTF16ToUTF8(actual_title)); 273 EXPECT_EQ(new_title, base::UTF16ToUTF8(actual_title));
270 274
271 EXPECT_EQ(PrefixExpectedTabTitle(new_title), main_task->title()); 275 EXPECT_EQ(PrefixExpectedTabTitle(new_title), main_task->title());
272 EXPECT_EQ(PrefixExpectedTDIRowTitle(new_title), tdi_task->title()); 276 EXPECT_EQ(PrefixExpectedTDIRowTitle(new_title), tdi_task->title());
273 } 277 }
274 278
275 } // namespace task_manager 279 } // namespace task_manager
OLDNEW
« no previous file with comments | « base/feature_list.cc ('k') | chrome/browser/ui/extensions/hosted_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698