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