| 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/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/devtools/devtools_window.h" | 12 #include "chrome/browser/devtools/devtools_window.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.h" |
| 17 #include "chrome/browser/infobars/infobar_service.h" | 18 #include "chrome/browser/infobars/infobar_service.h" |
| 18 #include "chrome/browser/notifications/desktop_notification_service.h" | 19 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 19 #include "chrome/browser/notifications/notification.h" | 20 #include "chrome/browser/notifications/notification.h" |
| 20 #include "chrome/browser/notifications/notification_test_util.h" | 21 #include "chrome/browser/notifications/notification_test_util.h" |
| 21 #include "chrome/browser/notifications/notification_ui_manager.h" | 22 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/task_manager/resource_provider.h" | 24 #include "chrome/browser/task_manager/resource_provider.h" |
| 24 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 25 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
| 25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/browser/ui/browser_dialogs.h" | 27 #include "chrome/browser/ui/browser_dialogs.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 TaskManager::GetInstance()->KillProcess(2); | 393 TaskManager::GetInstance()->KillProcess(2); |
| 393 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); | 394 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); |
| 394 | 395 |
| 395 // Reload the extension using the "crashed extension" infobar while the task | 396 // Reload the extension using the "crashed extension" infobar while the task |
| 396 // manager is still visible. Make sure we don't crash and the extension | 397 // manager is still visible. Make sure we don't crash and the extension |
| 397 // gets reloaded and noticed in the task manager. | 398 // gets reloaded and noticed in the task manager. |
| 398 InfoBarService* infobar_service = InfoBarService::FromWebContents( | 399 InfoBarService* infobar_service = InfoBarService::FromWebContents( |
| 399 browser()->tab_strip_model()->GetActiveWebContents()); | 400 browser()->tab_strip_model()->GetActiveWebContents()); |
| 400 ASSERT_EQ(1U, infobar_service->infobar_count()); | 401 ASSERT_EQ(1U, infobar_service->infobar_count()); |
| 401 ConfirmInfoBarDelegate* delegate = | 402 ConfirmInfoBarDelegate* delegate = |
| 402 infobar_service->infobar_at(0)->AsConfirmInfoBarDelegate(); | 403 infobar_service->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate(); |
| 403 ASSERT_TRUE(delegate); | 404 ASSERT_TRUE(delegate); |
| 404 delegate->Accept(); | 405 delegate->Accept(); |
| 405 TaskManagerBrowserTestUtil::WaitForWebResourceChange(3); | 406 TaskManagerBrowserTestUtil::WaitForWebResourceChange(3); |
| 406 } | 407 } |
| 407 | 408 |
| 408 #if defined(OS_WIN) | 409 #if defined(OS_WIN) |
| 409 // http://crbug.com/93158. | 410 // http://crbug.com/93158. |
| 410 #define MAYBE_ReloadExtension DISABLED_ReloadExtension | 411 #define MAYBE_ReloadExtension DISABLED_ReloadExtension |
| 411 #else | 412 #else |
| 412 #define MAYBE_ReloadExtension ReloadExtension | 413 #define MAYBE_ReloadExtension ReloadExtension |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 // Now add showing the task manager to the queue, and watch for the right | 541 // Now add showing the task manager to the queue, and watch for the right |
| 541 // number of reources to show up. | 542 // number of reources to show up. |
| 542 base::MessageLoop::current()->PostTask( | 543 base::MessageLoop::current()->PostTask( |
| 543 FROM_HERE, | 544 FROM_HERE, |
| 544 base::Bind(&TaskManagerNoShowBrowserTest::ShowTaskManager, | 545 base::Bind(&TaskManagerNoShowBrowserTest::ShowTaskManager, |
| 545 base::Unretained(this))); | 546 base::Unretained(this))); |
| 546 TaskManagerBrowserTestUtil::WaitForWebResourceChange(2); | 547 TaskManagerBrowserTestUtil::WaitForWebResourceChange(2); |
| 547 } | 548 } |
| 548 | 549 |
| 549 #endif | 550 #endif |
| OLD | NEW |