| 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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 10 #include "chrome/browser/background/background_contents_service.h" | 10 #include "chrome/browser/background/background_contents_service.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return TaskManager::GetInstance()->model(); | 63 return TaskManager::GetInstance()->model(); |
| 64 } | 64 } |
| 65 protected: | 65 protected: |
| 66 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 66 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 67 ExtensionBrowserTest::SetUpCommandLine(command_line); | 67 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 68 | 68 |
| 69 // Do not prelaunch the GPU process for these tests because it will show | 69 // Do not prelaunch the GPU process for these tests because it will show |
| 70 // up in task manager but whether it appears before or after the new tab | 70 // up in task manager but whether it appears before or after the new tab |
| 71 // renderer process is not well defined. | 71 // renderer process is not well defined. |
| 72 command_line->AppendSwitch(switches::kDisableGpuProcessPrelaunch); | 72 command_line->AppendSwitch(switches::kDisableGpuProcessPrelaunch); |
| 73 #if !defined(USE_AURA) && (defined(OS_MACOSX) || defined(OS_WIN)) | |
| 74 // Browserless panels refactor not completed for Linux yet. | |
| 75 command_line->AppendSwitch(switches::kBrowserlessPanels); | |
| 76 #endif | |
| 77 } | 73 } |
| 78 }; | 74 }; |
| 79 | 75 |
| 80 #if defined(OS_MACOSX) || defined(OS_LINUX) | 76 #if defined(OS_MACOSX) || defined(OS_LINUX) |
| 81 #define MAYBE_ShutdownWhileOpen DISABLED_ShutdownWhileOpen | 77 #define MAYBE_ShutdownWhileOpen DISABLED_ShutdownWhileOpen |
| 82 #else | 78 #else |
| 83 #define MAYBE_ShutdownWhileOpen ShutdownWhileOpen | 79 #define MAYBE_ShutdownWhileOpen ShutdownWhileOpen |
| 84 #endif | 80 #endif |
| 85 | 81 |
| 86 // Regression test for http://crbug.com/13361 | 82 // Regression test for http://crbug.com/13361 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 112 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), prefix, true)); | 108 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), prefix, true)); |
| 113 | 109 |
| 114 // Close the tab and verify that we notice. | 110 // Close the tab and verify that we notice. |
| 115 WebContents* first_tab = | 111 WebContents* first_tab = |
| 116 chrome::GetTabContentsAt(browser(), 0)->web_contents(); | 112 chrome::GetTabContentsAt(browser(), 0)->web_contents(); |
| 117 ASSERT_TRUE(first_tab); | 113 ASSERT_TRUE(first_tab); |
| 118 chrome::CloseWebContents(browser(), first_tab); | 114 chrome::CloseWebContents(browser(), first_tab); |
| 119 TaskManagerBrowserTestUtil::WaitForResourceChange(2); | 115 TaskManagerBrowserTestUtil::WaitForResourceChange(2); |
| 120 } | 116 } |
| 121 | 117 |
| 122 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticePanelChanges) { | 118 #if defined(USE_ASH) |
| 123 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 119 // This test fails on Ash because task manager treats view type |
| 124 switches::kBrowserlessPanels)) | 120 // Panels differently for Ash. |
| 121 #define MAYBE_NoticePanelChanges FAILS_NoticePanelChanges |
| 122 #else |
| 123 #define MAYBE_NoticePanelChanges NoticePanelChanges |
| 124 #endif |
| 125 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, MAYBE_NoticePanelChanges) { |
| 126 if (!PanelManager::UseBrowserlessPanels()) |
| 125 return; | 127 return; |
| 126 | 128 |
| 127 EXPECT_EQ(0, model()->ResourceCount()); | 129 EXPECT_EQ(0, model()->ResourceCount()); |
| 128 | 130 |
| 129 // Show the task manager. This populates the model, and helps with debugging | 131 // Show the task manager. This populates the model, and helps with debugging |
| 130 // (you see the task manager). | 132 // (you see the task manager). |
| 131 browser()->window()->ShowTaskManager(); | 133 browser()->window()->ShowTaskManager(); |
| 132 | 134 |
| 133 // Browser and the New Tab Page. | 135 // Browser and the New Tab Page. |
| 134 TaskManagerBrowserTestUtil::WaitForResourceChange(2); | 136 TaskManagerBrowserTestUtil::WaitForResourceChange(2); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 TaskManagerBrowserTestUtil::WaitForResourceChange(3); | 533 TaskManagerBrowserTestUtil::WaitForResourceChange(3); |
| 532 | 534 |
| 533 // Check that we get some value for the cache columns. | 535 // Check that we get some value for the cache columns. |
| 534 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), | 536 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), |
| 535 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 537 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 536 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), | 538 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), |
| 537 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 539 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 538 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), | 540 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), |
| 539 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 541 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 540 } | 542 } |
| OLD | NEW |