| 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/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 WebContents* first_tab = | 116 WebContents* first_tab = |
| 117 chrome::GetTabContentsAt(browser(), 0)->web_contents(); | 117 chrome::GetTabContentsAt(browser(), 0)->web_contents(); |
| 118 ASSERT_TRUE(first_tab); | 118 ASSERT_TRUE(first_tab); |
| 119 chrome::CloseWebContents(browser(), first_tab); | 119 chrome::CloseWebContents(browser(), first_tab); |
| 120 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); | 120 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); |
| 121 } | 121 } |
| 122 | 122 |
| 123 #if defined(USE_ASH) | 123 #if defined(USE_ASH) |
| 124 // This test fails on Ash because task manager treats view type | 124 // This test fails on Ash because task manager treats view type |
| 125 // Panels differently for Ash. | 125 // Panels differently for Ash. |
| 126 #define MAYBE_NoticePanelChanges FAILS_NoticePanelChanges | 126 #define MAYBE_NoticePanelChanges DISABLED_NoticePanelChanges |
| 127 #else | 127 #else |
| 128 #define MAYBE_NoticePanelChanges NoticePanelChanges | 128 #define MAYBE_NoticePanelChanges NoticePanelChanges |
| 129 #endif | 129 #endif |
| 130 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, MAYBE_NoticePanelChanges) { | 130 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, MAYBE_NoticePanelChanges) { |
| 131 EXPECT_EQ(0, model()->ResourceCount()); | 131 EXPECT_EQ(0, model()->ResourceCount()); |
| 132 | 132 |
| 133 // Show the task manager. This populates the model, and helps with debugging | 133 // Show the task manager. This populates the model, and helps with debugging |
| 134 // (you see the task manager). | 134 // (you see the task manager). |
| 135 browser()->window()->ShowTaskManager(); | 135 browser()->window()->ShowTaskManager(); |
| 136 | 136 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 ASSERT_TRUE(found); | 251 ASSERT_TRUE(found); |
| 252 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); | 252 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); |
| 253 EXPECT_EQ(0, TaskManager::GetBackgroundPageCount()); | 253 EXPECT_EQ(0, TaskManager::GetBackgroundPageCount()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 #if defined(USE_ASH) | 256 #if defined(USE_ASH) |
| 257 // This test fails on Ash because task manager treats view type | 257 // This test fails on Ash because task manager treats view type |
| 258 // Panels differently for Ash. | 258 // Panels differently for Ash. |
| 259 #define MAYBE_KillPanelExtension FAILS_KillPanelExtension | 259 #define MAYBE_KillPanelExtension DISABLED_KillPanelExtension |
| 260 #else | 260 #else |
| 261 #define MAYBE_KillPanelExtension KillPanelExtension | 261 #define MAYBE_KillPanelExtension KillPanelExtension |
| 262 #endif | 262 #endif |
| 263 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, MAYBE_KillPanelExtension) { | 263 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, MAYBE_KillPanelExtension) { |
| 264 EXPECT_EQ(0, model()->ResourceCount()); | 264 EXPECT_EQ(0, model()->ResourceCount()); |
| 265 | 265 |
| 266 // Show the task manager. This populates the model, and helps with debugging | 266 // Show the task manager. This populates the model, and helps with debugging |
| 267 // (you see the task manager). | 267 // (you see the task manager). |
| 268 browser()->window()->ShowTaskManager(); | 268 browser()->window()->ShowTaskManager(); |
| 269 | 269 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 TaskManagerBrowserTestUtil::WaitForWebResourceChange(2); | 600 TaskManagerBrowserTestUtil::WaitForWebResourceChange(2); |
| 601 | 601 |
| 602 // Check that we get some value for the cache columns. | 602 // Check that we get some value for the cache columns. |
| 603 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(resource_count), | 603 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(resource_count), |
| 604 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 604 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 605 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(resource_count), | 605 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(resource_count), |
| 606 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 606 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 607 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(resource_count), | 607 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(resource_count), |
| 608 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 608 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 609 } | 609 } |
| OLD | NEW |