| 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/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/background/background_contents_service.h" | 10 #include "chrome/browser/background/background_contents_service.h" |
| 11 #include "chrome/browser/background/background_contents_service_factory.h" | 11 #include "chrome/browser/background/background_contents_service_factory.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/extensions/extension_browsertest.h" | 13 #include "chrome/browser/extensions/extension_browsertest.h" |
| 14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/extensions/extension_system.h" | 15 #include "chrome/browser/extensions/extension_system.h" |
| 16 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 16 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
| 17 #include "chrome/browser/infobars/infobar_service.h" | 17 #include "chrome/browser/infobars/infobar_service.h" |
| 18 #include "chrome/browser/notifications/desktop_notification_service.h" | 18 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 19 #include "chrome/browser/notifications/notification.h" | 19 #include "chrome/browser/notifications/notification.h" |
| 20 #include "chrome/browser/notifications/notification_test_util.h" | 20 #include "chrome/browser/notifications/notification_test_util.h" |
| 21 #include "chrome/browser/notifications/notification_ui_manager.h" | 21 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 23 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
| 24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/browser/ui/browser_dialogs.h" |
| 25 #include "chrome/browser/ui/browser_navigator.h" | 26 #include "chrome/browser/ui/browser_navigator.h" |
| 26 #include "chrome/browser/ui/browser_window.h" | 27 #include "chrome/browser/ui/browser_window.h" |
| 27 #include "chrome/browser/ui/panels/panel.h" | 28 #include "chrome/browser/ui/panels/panel.h" |
| 28 #include "chrome/browser/ui/panels/panel_manager.h" | 29 #include "chrome/browser/ui/panels/panel_manager.h" |
| 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 30 #include "chrome/browser/web_applications/web_app.h" | 31 #include "chrome/browser/web_applications/web_app.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 32 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
| 34 #include "chrome/test/base/in_process_browser_test.h" | 35 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 73 |
| 73 virtual void SetUpOnMainThread() OVERRIDE { | 74 virtual void SetUpOnMainThread() OVERRIDE { |
| 74 ExtensionBrowserTest::SetUpOnMainThread(); | 75 ExtensionBrowserTest::SetUpOnMainThread(); |
| 75 | 76 |
| 76 EXPECT_EQ(0, model()->ResourceCount()); | 77 EXPECT_EQ(0, model()->ResourceCount()); |
| 77 | 78 |
| 78 EXPECT_EQ(0, TaskManager::GetBackgroundPageCount()); | 79 EXPECT_EQ(0, TaskManager::GetBackgroundPageCount()); |
| 79 | 80 |
| 80 // Show the task manager. This populates the model, and helps with debugging | 81 // Show the task manager. This populates the model, and helps with debugging |
| 81 // (you see the task manager). | 82 // (you see the task manager). |
| 82 browser()->window()->ShowTaskManager(); | 83 chrome::ShowTaskManager(browser(), false); |
| 83 | 84 |
| 84 // New Tab Page. | 85 // New Tab Page. |
| 85 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); | 86 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); |
| 86 } | 87 } |
| 87 | 88 |
| 88 void Refresh() { | 89 void Refresh() { |
| 89 model()->Refresh(); | 90 model()->Refresh(); |
| 90 } | 91 } |
| 91 | 92 |
| 92 protected: | 93 protected: |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 // Check that we get some value for the cache columns. | 542 // Check that we get some value for the cache columns. |
| 542 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(resource_count), | 543 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(resource_count), |
| 543 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 544 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 544 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(resource_count), | 545 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(resource_count), |
| 545 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 546 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 546 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(resource_count), | 547 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(resource_count), |
| 547 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 548 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 548 } | 549 } |
| 549 | 550 |
| 550 #endif | 551 #endif |
| OLD | NEW |