| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 5 #include "chrome/browser/task_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, FLAKY_NoticeExtensionChanges) { | 121 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, FLAKY_NoticeExtensionChanges) { |
| 122 EXPECT_EQ(0, model()->ResourceCount()); | 122 EXPECT_EQ(0, model()->ResourceCount()); |
| 123 | 123 |
| 124 // Show the task manager. This populates the model, and helps with debugging | 124 // Show the task manager. This populates the model, and helps with debugging |
| 125 // (you see the task manager). | 125 // (you see the task manager). |
| 126 browser()->window()->ShowTaskManager(); | 126 browser()->window()->ShowTaskManager(); |
| 127 | 127 |
| 128 // Browser and the New Tab Page. | 128 // Browser and the New Tab Page. |
| 129 EXPECT_EQ(2, model()->ResourceCount()); | 129 EXPECT_EQ(2, model()->ResourceCount()); |
| 130 | 130 |
| 131 // Loading an extension should result in a new resource being | 131 // Loading an extension with a background page should result in a new |
| 132 // created for it. | 132 // resource being created for it. |
| 133 ASSERT_TRUE(LoadExtension( | |
| 134 test_data_dir_.AppendASCII("common").AppendASCII("one_in_shelf"))); | |
| 135 WaitForResourceChange(3); | |
| 136 | |
| 137 // Make sure we also recognize extensions with just background pages. | |
| 138 ASSERT_TRUE(LoadExtension( | 133 ASSERT_TRUE(LoadExtension( |
| 139 test_data_dir_.AppendASCII("common").AppendASCII("background_page"))); | 134 test_data_dir_.AppendASCII("common").AppendASCII("background_page"))); |
| 140 WaitForResourceChange(4); | 135 WaitForResourceChange(3); |
| 141 } | 136 } |
| 142 | 137 |
| 143 // Times out on Vista; disabled to keep tests fast. http://crbug.com/44991 | 138 // Times out on Vista; disabled to keep tests fast. http://crbug.com/44991 |
| 144 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
| 145 #define KillExtension DISABLED_KillExtension | 140 #define KillExtension DISABLED_KillExtension |
| 146 #endif | 141 #endif |
| 147 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, KillExtension) { | 142 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, KillExtension) { |
| 148 // Show the task manager. This populates the model, and helps with debugging | 143 // Show the task manager. This populates the model, and helps with debugging |
| 149 // (you see the task manager). | 144 // (you see the task manager). |
| 150 browser()->window()->ShowTaskManager(); | 145 browser()->window()->ShowTaskManager(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 WaitForResourceChange(3); | 251 WaitForResourceChange(3); |
| 257 | 252 |
| 258 // Check that we get some value for the cache columns. | 253 // Check that we get some value for the cache columns. |
| 259 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), | 254 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), |
| 260 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 255 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 261 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), | 256 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), |
| 262 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 257 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 263 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), | 258 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), |
| 264 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 259 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 265 } | 260 } |
| OLD | NEW |