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

Unified Diff: chrome/browser/oom_priority_manager_browsertest.cc

Issue 10106011: Fixes FindBar crash. The crash appears to be because if you select a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/oom_priority_manager_browsertest.cc
diff --git a/chrome/browser/oom_priority_manager_browsertest.cc b/chrome/browser/oom_priority_manager_browsertest.cc
index 03e02c4c5d21a5579fa403414635815b2b0c35c9..d064da316a9749356c00b017bea467283508d8d2 100644
--- a/chrome/browser/oom_priority_manager_browsertest.cc
+++ b/chrome/browser/oom_priority_manager_browsertest.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -98,12 +99,18 @@ IN_PROC_BROWSER_TEST_F(OomPriorityManagerTest, OomPriorityManagerBasics) {
// Running when all tabs are discarded should do nothing.
EXPECT_FALSE(g_browser_process->oom_priority_manager()->DiscardTab());
+ // Force creation of the FindBarController.
+ browser()->GetFindBarController();
+
// Select the first tab. It should reload.
WindowedNotificationObserver reload1(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
browser()->SelectNumberedTab(0);
reload1.Wait();
+ // Make sure the FindBarController gets the right TabContentsWrapper.
+ EXPECT_EQ(browser()->GetFindBarController()->tab_contents(),
+ browser()->GetSelectedTabContentsWrapper());
EXPECT_EQ(0, browser()->active_index());
EXPECT_FALSE(browser()->IsTabDiscarded(0));
EXPECT_TRUE(browser()->IsTabDiscarded(1));
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698