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

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

Issue 7810002: Move infobar handling to a tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/background/background_contents_service.h" 9 #include "chrome/browser/background/background_contents_service.h"
10 #include "chrome/browser/background/background_contents_service_factory.h" 10 #include "chrome/browser/background/background_contents_service_factory.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/extensions/extension_browsertest.h" 12 #include "chrome/browser/extensions/extension_browsertest.h"
13 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/infobars/infobar_tab_helper.h"
14 #include "chrome/browser/notifications/desktop_notification_service.h" 15 #include "chrome/browser/notifications/desktop_notification_service.h"
15 #include "chrome/browser/notifications/notification.h" 16 #include "chrome/browser/notifications/notification.h"
16 #include "chrome/browser/notifications/notification_test_util.h" 17 #include "chrome/browser/notifications/notification_test_util.h"
17 #include "chrome/browser/notifications/notification_ui_manager.h" 18 #include "chrome/browser/notifications/notification_ui_manager.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 20 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
20 #include "chrome/browser/tabs/tab_strip_model.h" 21 #include "chrome/browser/tabs/tab_strip_model.h"
21 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" 22 #include "chrome/browser/task_manager/task_manager_browsertest_util.h"
22 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_navigator.h" 24 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 EXPECT_TRUE(model()->GetResourceExtension(1) == NULL); 367 EXPECT_TRUE(model()->GetResourceExtension(1) == NULL);
367 ASSERT_TRUE(model()->GetResourceExtension(2) != NULL); 368 ASSERT_TRUE(model()->GetResourceExtension(2) != NULL);
368 369
369 // Kill the extension process and make sure we notice it. 370 // Kill the extension process and make sure we notice it.
370 TaskManager::GetInstance()->KillProcess(2); 371 TaskManager::GetInstance()->KillProcess(2);
371 TaskManagerBrowserTestUtil::WaitForResourceChange(2); 372 TaskManagerBrowserTestUtil::WaitForResourceChange(2);
372 373
373 // Reload the extension using the "crashed extension" infobar while the task 374 // Reload the extension using the "crashed extension" infobar while the task
374 // manager is still visible. Make sure we don't crash and the extension 375 // manager is still visible. Make sure we don't crash and the extension
375 // gets reloaded and noticed in the task manager. 376 // gets reloaded and noticed in the task manager.
376 TabContentsWrapper* current_tab = browser()->GetSelectedTabContentsWrapper(); 377 TabContentsWrapper* current_tab = browser()->GetSelectedTabContentsWrapper();
Peter Kasting 2011/08/31 18:47:32 Nit: Convert this TCW* to an InfoBarTabHelper*
377 ASSERT_EQ(1U, current_tab->infobar_count()); 378 ASSERT_EQ(1U, current_tab->infobar_tab_helper()->infobar_count());
378 ConfirmInfoBarDelegate* delegate = 379 ConfirmInfoBarDelegate* delegate = current_tab->infobar_tab_helper()->
379 current_tab->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); 380 GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate();
380 ASSERT_TRUE(delegate); 381 ASSERT_TRUE(delegate);
381 delegate->Accept(); 382 delegate->Accept();
382 TaskManagerBrowserTestUtil::WaitForResourceChange(3); 383 TaskManagerBrowserTestUtil::WaitForResourceChange(3);
383 } 384 }
384 385
385 #if defined(OS_WIN) 386 #if defined(OS_WIN)
386 // Bug 93158. 387 // Bug 93158.
387 #define MAYBE_ReloadExtension FLAKY_ReloadExtension 388 #define MAYBE_ReloadExtension FLAKY_ReloadExtension
388 #else 389 #else
389 #define MAYBE_ReloadExtension ReloadExtension 390 #define MAYBE_ReloadExtension ReloadExtension
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 TaskManagerBrowserTestUtil::WaitForResourceChange(3); 450 TaskManagerBrowserTestUtil::WaitForResourceChange(3);
450 451
451 // Check that we get some value for the cache columns. 452 // Check that we get some value for the cache columns.
452 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), 453 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2),
453 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 454 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
454 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), 455 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2),
455 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 456 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
456 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), 457 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2),
457 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 458 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
458 } 459 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698