| OLD | NEW |
| 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 Loading... |
| 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" | |
| 42 #include "content/public/test/browser_test_utils.h" | 41 #include "content/public/test/browser_test_utils.h" |
| 43 #include "content/public/test/content_browser_test_utils.h" | 42 #include "content/public/test/content_browser_test_utils.h" |
| 44 #include "extensions/browser/extension_system.h" | 43 #include "extensions/browser/extension_system.h" |
| 45 #include "extensions/common/extension.h" | 44 #include "extensions/common/extension.h" |
| 46 #include "net/dns/mock_host_resolver.h" | 45 #include "net/dns/mock_host_resolver.h" |
| 47 #include "net/test/embedded_test_server/embedded_test_server.h" | 46 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 48 #include "testing/gtest/include/gtest/gtest.h" | 47 #include "testing/gtest/include/gtest/gtest.h" |
| 49 #include "ui/base/l10n/l10n_util.h" | 48 #include "ui/base/l10n/l10n_util.h" |
| 50 #include "ui/base/page_transition_types.h" | 49 #include "ui/base/page_transition_types.h" |
| 51 | 50 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // --site-per-process, which enables out of process iframes (OOPIFs). | 151 // --site-per-process, which enables out of process iframes (OOPIFs). |
| 153 class TaskManagerOOPIFBrowserTest : public TaskManagerBrowserTest, | 152 class TaskManagerOOPIFBrowserTest : public TaskManagerBrowserTest, |
| 154 public testing::WithParamInterface<bool> { | 153 public testing::WithParamInterface<bool> { |
| 155 public: | 154 public: |
| 156 TaskManagerOOPIFBrowserTest() {} | 155 TaskManagerOOPIFBrowserTest() {} |
| 157 | 156 |
| 158 protected: | 157 protected: |
| 159 void SetUpCommandLine(base::CommandLine* command_line) override { | 158 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 160 TaskManagerBrowserTest::SetUpCommandLine(command_line); | 159 TaskManagerBrowserTest::SetUpCommandLine(command_line); |
| 161 if (GetParam()) | 160 if (GetParam()) |
| 162 command_line->AppendSwitch(switches::kSitePerProcess); | 161 content::IsolateAllSitesForTesting(command_line); |
| 163 } | 162 } |
| 164 | 163 |
| 165 bool ShouldExpectSubframes() { | 164 bool ShouldExpectSubframes() { |
| 166 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 165 return content::AreAllSitesIsolatedForTesting(); |
| 167 switches::kSitePerProcess); | |
| 168 } | 166 } |
| 169 | 167 |
| 170 private: | 168 private: |
| 171 DISALLOW_COPY_AND_ASSIGN(TaskManagerOOPIFBrowserTest); | 169 DISALLOW_COPY_AND_ASSIGN(TaskManagerOOPIFBrowserTest); |
| 172 }; | 170 }; |
| 173 | 171 |
| 174 INSTANTIATE_TEST_CASE_P(, TaskManagerOOPIFBrowserTest, ::testing::Bool()); | 172 INSTANTIATE_TEST_CASE_P(, TaskManagerOOPIFBrowserTest, ::testing::Bool()); |
| 175 | 173 |
| 176 #if defined(OS_MACOSX) || defined(OS_LINUX) | 174 #if defined(OS_MACOSX) || defined(OS_LINUX) |
| 177 #define MAYBE_ShutdownWhileOpen DISABLED_ShutdownWhileOpen | 175 #define MAYBE_ShutdownWhileOpen DISABLED_ShutdownWhileOpen |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness"))); | 1204 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness"))); |
| 1207 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe())); | 1205 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe())); |
| 1208 | 1206 |
| 1209 HideTaskManager(); | 1207 HideTaskManager(); |
| 1210 ShowTaskManager(); | 1208 ShowTaskManager(); |
| 1211 | 1209 |
| 1212 ASSERT_NO_FATAL_FAILURE( | 1210 ASSERT_NO_FATAL_FAILURE( |
| 1213 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness"))); | 1211 WaitForTaskManagerRows(1, MatchTab("Title Of Awesomeness"))); |
| 1214 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe())); | 1212 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnySubframe())); |
| 1215 } | 1213 } |
| OLD | NEW |