| 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 "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 int FindResourceIndex(const base::string16& title) { | 107 int FindResourceIndex(const base::string16& title) { |
| 108 for (int i = 0; i < model()->ResourceCount(); ++i) { | 108 for (int i = 0; i < model()->ResourceCount(); ++i) { |
| 109 if (title == model()->GetResourceTitle(i)) | 109 if (title == model()->GetResourceTitle(i)) |
| 110 return i; | 110 return i; |
| 111 } | 111 } |
| 112 return -1; | 112 return -1; |
| 113 } | 113 } |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 void SetUpCommandLine(CommandLine* command_line) override { | 116 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 117 ExtensionBrowserTest::SetUpCommandLine(command_line); | 117 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 118 | 118 |
| 119 // Do not launch device discovery process. | 119 // Do not launch device discovery process. |
| 120 command_line->AppendSwitch(switches::kDisableDeviceDiscoveryNotifications); | 120 command_line->AppendSwitch(switches::kDisableDeviceDiscoveryNotifications); |
| 121 } | 121 } |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserTest); | 124 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserTest); |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 // Parameterized variant of TaskManagerBrowserTest which runs with/without | 127 // Parameterized variant of TaskManagerBrowserTest which runs with/without |
| 128 // --site-per-process, which enables out of process iframes (OOPIFs). | 128 // --site-per-process, which enables out of process iframes (OOPIFs). |
| 129 class TaskManagerOOPIFBrowserTest : public TaskManagerBrowserTest, | 129 class TaskManagerOOPIFBrowserTest : public TaskManagerBrowserTest, |
| 130 public testing::WithParamInterface<bool> { | 130 public testing::WithParamInterface<bool> { |
| 131 public: | 131 public: |
| 132 TaskManagerOOPIFBrowserTest() {} | 132 TaskManagerOOPIFBrowserTest() {} |
| 133 | 133 |
| 134 protected: | 134 protected: |
| 135 void SetUpCommandLine(CommandLine* command_line) override { | 135 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 136 TaskManagerBrowserTest::SetUpCommandLine(command_line); | 136 TaskManagerBrowserTest::SetUpCommandLine(command_line); |
| 137 if (GetParam()) | 137 if (GetParam()) |
| 138 command_line->AppendSwitch(switches::kSitePerProcess); | 138 command_line->AppendSwitch(switches::kSitePerProcess); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool ShouldExpectSubframes() { | 141 bool ShouldExpectSubframes() { |
| 142 return CommandLine::ForCurrentProcess()->HasSwitch( | 142 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 143 switches::kSitePerProcess); | 143 switches::kSitePerProcess); |
| 144 } | 144 } |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 DISALLOW_COPY_AND_ASSIGN(TaskManagerOOPIFBrowserTest); | 147 DISALLOW_COPY_AND_ASSIGN(TaskManagerOOPIFBrowserTest); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 INSTANTIATE_TEST_CASE_P(, TaskManagerOOPIFBrowserTest, ::testing::Bool()); | 150 INSTANTIATE_TEST_CASE_P(, TaskManagerOOPIFBrowserTest, ::testing::Bool()); |
| 151 | 151 |
| 152 #if defined(OS_MACOSX) || defined(OS_LINUX) | 152 #if defined(OS_MACOSX) || defined(OS_LINUX) |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 } else { | 1036 } else { |
| 1037 ASSERT_NO_FATAL_FAILURE( | 1037 ASSERT_NO_FATAL_FAILURE( |
| 1038 WaitForTaskManagerRows(0, MatchSubframe("http://b.com/"))); | 1038 WaitForTaskManagerRows(0, MatchSubframe("http://b.com/"))); |
| 1039 ASSERT_NO_FATAL_FAILURE( | 1039 ASSERT_NO_FATAL_FAILURE( |
| 1040 WaitForTaskManagerRows(1, MatchSubframe("http://c.com/"))); | 1040 WaitForTaskManagerRows(1, MatchSubframe("http://c.com/"))); |
| 1041 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnySubframe())); | 1041 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnySubframe())); |
| 1042 } | 1042 } |
| 1043 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchTab("aac"))); | 1043 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchTab("aac"))); |
| 1044 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); | 1044 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); |
| 1045 } | 1045 } |
| OLD | NEW |