Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: chrome/browser/task_manager/task_manager_browsertest.cc

Issue 12066003: Remove TabStripModel wrapper use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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/api/infobars/confirm_infobar_delegate.h" 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
11 #include "chrome/browser/api/infobars/infobar_service.h" 11 #include "chrome/browser/api/infobars/infobar_service.h"
12 #include "chrome/browser/background/background_contents_service.h" 12 #include "chrome/browser/background/background_contents_service.h"
13 #include "chrome/browser/background/background_contents_service_factory.h" 13 #include "chrome/browser/background/background_contents_service_factory.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/extensions/extension_browsertest.h" 15 #include "chrome/browser/extensions/extension_browsertest.h"
16 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
17 #include "chrome/browser/extensions/extension_system.h" 17 #include "chrome/browser/extensions/extension_system.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_navigator.h" 25 #include "chrome/browser/ui/browser_navigator.h"
26 #include "chrome/browser/ui/browser_tabstrip.h"
27 #include "chrome/browser/ui/browser_window.h" 26 #include "chrome/browser/ui/browser_window.h"
28 #include "chrome/browser/ui/panels/panel.h" 27 #include "chrome/browser/ui/panels/panel.h"
29 #include "chrome/browser/ui/panels/panel_manager.h" 28 #include "chrome/browser/ui/panels/panel_manager.h"
30 #include "chrome/browser/ui/tabs/tab_strip_model.h" 29 #include "chrome/browser/ui/tabs/tab_strip_model.h"
31 #include "chrome/browser/web_applications/web_app.h" 30 #include "chrome/browser/web_applications/web_app.h"
32 #include "chrome/common/chrome_notification_types.h" 31 #include "chrome/common/chrome_notification_types.h"
33 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/extensions/extension.h" 33 #include "chrome/common/extensions/extension.h"
35 #include "chrome/test/base/in_process_browser_test.h" 34 #include "chrome/test/base/in_process_browser_test.h"
36 #include "chrome/test/base/ui_test_utils.h" 35 #include "chrome/test/base/ui_test_utils.h"
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 ASSERT_TRUE(model()->GetResourceExtension(2) != NULL); 465 ASSERT_TRUE(model()->GetResourceExtension(2) != NULL);
467 466
468 // Kill the extension process and make sure we notice it. 467 // Kill the extension process and make sure we notice it.
469 TaskManager::GetInstance()->KillProcess(2); 468 TaskManager::GetInstance()->KillProcess(2);
470 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1); 469 TaskManagerBrowserTestUtil::WaitForWebResourceChange(1);
471 470
472 // Reload the extension using the "crashed extension" infobar while the task 471 // Reload the extension using the "crashed extension" infobar while the task
473 // manager is still visible. Make sure we don't crash and the extension 472 // manager is still visible. Make sure we don't crash and the extension
474 // gets reloaded and noticed in the task manager. 473 // gets reloaded and noticed in the task manager.
475 InfoBarService* infobar_service = InfoBarService::FromWebContents( 474 InfoBarService* infobar_service = InfoBarService::FromWebContents(
476 chrome::GetActiveWebContents(browser())); 475 browser()->tab_strip_model()->GetActiveWebContents());
477 ASSERT_EQ(1U, infobar_service->GetInfoBarCount()); 476 ASSERT_EQ(1U, infobar_service->GetInfoBarCount());
478 ConfirmInfoBarDelegate* delegate = infobar_service-> 477 ConfirmInfoBarDelegate* delegate = infobar_service->
479 GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); 478 GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate();
480 ASSERT_TRUE(delegate); 479 ASSERT_TRUE(delegate);
481 delegate->Accept(); 480 delegate->Accept();
482 TaskManagerBrowserTestUtil::WaitForWebResourceChange(3); 481 TaskManagerBrowserTestUtil::WaitForWebResourceChange(3);
483 } 482 }
484 483
485 #if defined(OS_WIN) 484 #if defined(OS_WIN)
486 // http://crbug.com/93158. 485 // http://crbug.com/93158.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // Check that we get some value for the cache columns. 541 // Check that we get some value for the cache columns.
543 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(resource_count), 542 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(resource_count),
544 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 543 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
545 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(resource_count), 544 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(resource_count),
546 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 545 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
547 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(resource_count), 546 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(resource_count),
548 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 547 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
549 } 548 }
550 549
551 #endif 550 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698