| 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/task_manager.h" | 5 #include "chrome/browser/task_manager/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 "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/extensions/crashed_extension_infobar.h" | 12 #include "chrome/browser/extensions/crashed_extension_infobar.h" |
| 13 #include "chrome/browser/extensions/extension_browsertest.h" | 13 #include "chrome/browser/extensions/extension_browsertest.h" |
| 14 #include "chrome/browser/notifications/desktop_notification_service.h" | 14 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 15 #include "chrome/browser/notifications/notification.h" |
| 15 #include "chrome/browser/notifications/notification_test_util.h" | 16 #include "chrome/browser/notifications/notification_test_util.h" |
| 16 #include "chrome/browser/notifications/notification_ui_manager.h" | 17 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 17 #include "chrome/browser/profile.h" | 18 #include "chrome/browser/profile.h" |
| 18 #include "chrome/browser/tab_contents/infobar_delegate.h" | 19 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 19 #include "chrome/browser/tab_contents/tab_contents.h" | 20 #include "chrome/browser/tab_contents/tab_contents.h" |
| 20 #include "chrome/browser/tabs/tab_strip_model.h" | 21 #include "chrome/browser/tabs/tab_strip_model.h" |
| 21 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/browser_navigator.h" | 23 #include "chrome/browser/ui/browser_navigator.h" |
| 23 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
| 24 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 Notification n1( | 194 Notification n1( |
| 194 GURL(), GURL(content), ASCIIToUTF16("Test 1"), string16(), del1.get()); | 195 GURL(), GURL(content), ASCIIToUTF16("Test 1"), string16(), del1.get()); |
| 195 scoped_refptr<NotificationDelegate> del2(new MockNotificationDelegate("n2")); | 196 scoped_refptr<NotificationDelegate> del2(new MockNotificationDelegate("n2")); |
| 196 Notification n2( | 197 Notification n2( |
| 197 GURL(), GURL(content), ASCIIToUTF16("Test 2"), string16(), del2.get()); | 198 GURL(), GURL(content), ASCIIToUTF16("Test 2"), string16(), del2.get()); |
| 198 | 199 |
| 199 notifications->Add(n1, browser()->profile()); | 200 notifications->Add(n1, browser()->profile()); |
| 200 WaitForResourceChange(3); | 201 WaitForResourceChange(3); |
| 201 notifications->Add(n2, browser()->profile()); | 202 notifications->Add(n2, browser()->profile()); |
| 202 WaitForResourceChange(4); | 203 WaitForResourceChange(4); |
| 203 notifications->Cancel(n1); | 204 notifications->CancelById(n1.notification_id()); |
| 204 WaitForResourceChange(3); | 205 WaitForResourceChange(3); |
| 205 notifications->Cancel(n2); | 206 notifications->CancelById(n2.notification_id()); |
| 206 WaitForResourceChange(2); | 207 WaitForResourceChange(2); |
| 207 } | 208 } |
| 208 | 209 |
| 209 // Times out on Vista; disabled to keep tests fast. http://crbug.com/44991 | 210 // Times out on Vista; disabled to keep tests fast. http://crbug.com/44991 |
| 210 #if defined(OS_WIN) | 211 #if defined(OS_WIN) |
| 211 #define KillExtension DISABLED_KillExtension | 212 #define KillExtension DISABLED_KillExtension |
| 212 #endif | 213 #endif |
| 213 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, KillExtension) { | 214 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, KillExtension) { |
| 214 // Show the task manager. This populates the model, and helps with debugging | 215 // Show the task manager. This populates the model, and helps with debugging |
| 215 // (you see the task manager). | 216 // (you see the task manager). |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 WaitForResourceChange(3); | 322 WaitForResourceChange(3); |
| 322 | 323 |
| 323 // Check that we get some value for the cache columns. | 324 // Check that we get some value for the cache columns. |
| 324 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), | 325 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), |
| 325 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 326 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 326 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), | 327 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), |
| 327 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 328 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 328 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), | 329 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), |
| 329 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 330 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 330 } | 331 } |
| OLD | NEW |