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

Side by Side Diff: chrome/browser/task_manager/task_manager_browsertest.cc

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Partial fixes to Nasko's comments. Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 20 matching lines...) Expand all
31 #include "chrome/browser/web_applications/web_app.h" 31 #include "chrome/browser/web_applications/web_app.h"
32 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/grit/generated_resources.h" 33 #include "chrome/grit/generated_resources.h"
34 #include "chrome/test/base/in_process_browser_test.h" 34 #include "chrome/test/base/in_process_browser_test.h"
35 #include "chrome/test/base/ui_test_utils.h" 35 #include "chrome/test/base/ui_test_utils.h"
36 #include "components/infobars/core/confirm_infobar_delegate.h" 36 #include "components/infobars/core/confirm_infobar_delegate.h"
37 #include "components/infobars/core/infobar.h" 37 #include "components/infobars/core/infobar.h"
38 #include "content/public/browser/notification_service.h" 38 #include "content/public/browser/notification_service.h"
39 #include "content/public/browser/page_navigator.h" 39 #include "content/public/browser/page_navigator.h"
40 #include "content/public/browser/render_frame_host.h" 40 #include "content/public/browser/render_frame_host.h"
41 #include "content/public/common/content_switches.h" 41 #include "content/public/common/site_isolation_policy.h"
42 #include "content/public/test/browser_test_utils.h" 42 #include "content/public/test/browser_test_utils.h"
43 #include "content/public/test/content_browser_test_utils.h" 43 #include "content/public/test/content_browser_test_utils.h"
44 #include "extensions/browser/extension_system.h" 44 #include "extensions/browser/extension_system.h"
45 #include "extensions/common/extension.h" 45 #include "extensions/common/extension.h"
46 #include "net/dns/mock_host_resolver.h" 46 #include "net/dns/mock_host_resolver.h"
47 #include "net/test/embedded_test_server/embedded_test_server.h" 47 #include "net/test/embedded_test_server/embedded_test_server.h"
48 #include "testing/gtest/include/gtest/gtest.h" 48 #include "testing/gtest/include/gtest/gtest.h"
49 #include "ui/base/l10n/l10n_util.h" 49 #include "ui/base/l10n/l10n_util.h"
50 #include "ui/base/page_transition_types.h" 50 #include "ui/base/page_transition_types.h"
51 51
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // --site-per-process, which enables out of process iframes (OOPIFs). 152 // --site-per-process, which enables out of process iframes (OOPIFs).
153 class TaskManagerOOPIFBrowserTest : public TaskManagerBrowserTest, 153 class TaskManagerOOPIFBrowserTest : public TaskManagerBrowserTest,
154 public testing::WithParamInterface<bool> { 154 public testing::WithParamInterface<bool> {
155 public: 155 public:
156 TaskManagerOOPIFBrowserTest() {} 156 TaskManagerOOPIFBrowserTest() {}
157 157
158 protected: 158 protected:
159 void SetUpCommandLine(base::CommandLine* command_line) override { 159 void SetUpCommandLine(base::CommandLine* command_line) override {
160 TaskManagerBrowserTest::SetUpCommandLine(command_line); 160 TaskManagerBrowserTest::SetUpCommandLine(command_line);
161 if (GetParam()) 161 if (GetParam())
162 command_line->AppendSwitch(switches::kSitePerProcess); 162 content::SiteIsolationPolicy::IsolateAllSitesForTesting(command_line);
163 } 163 }
164 164
165 bool ShouldExpectSubframes() { 165 bool ShouldExpectSubframes() {
166 return base::CommandLine::ForCurrentProcess()->HasSwitch( 166 return content::SiteIsolationPolicy::AreAllSitesIsolatedForTesting();
167 switches::kSitePerProcess);
168 } 167 }
169 168
170 private: 169 private:
171 DISALLOW_COPY_AND_ASSIGN(TaskManagerOOPIFBrowserTest); 170 DISALLOW_COPY_AND_ASSIGN(TaskManagerOOPIFBrowserTest);
172 }; 171 };
173 172
174 INSTANTIATE_TEST_CASE_P(, TaskManagerOOPIFBrowserTest, ::testing::Bool()); 173 INSTANTIATE_TEST_CASE_P(, TaskManagerOOPIFBrowserTest, ::testing::Bool());
175 174
176 #if defined(OS_MACOSX) || defined(OS_LINUX) 175 #if defined(OS_MACOSX) || defined(OS_LINUX)
177 #define MAYBE_ShutdownWhileOpen DISABLED_ShutdownWhileOpen 176 #define MAYBE_ShutdownWhileOpen DISABLED_ShutdownWhileOpen
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness"))); 1204 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness")));
1206 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe())); 1205 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe()));
1207 1206
1208 HideTaskManager(); 1207 HideTaskManager();
1209 ShowTaskManager(); 1208 ShowTaskManager();
1210 1209
1211 ASSERT_NO_FATAL_FAILURE( 1210 ASSERT_NO_FATAL_FAILURE(
1212 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness"))); 1211 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness")));
1213 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe())); 1212 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe()));
1214 } 1213 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698