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

Side by Side Diff: chrome/browser/ui/search/instant_extended_interactive_uitest.cc

Issue 17521002: Added a check in Searchbox::OnMostVisitedChanged() to prevent duplicate notifications regarding mos… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <sstream> 5 #include <sstream>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram_base.h" 9 #include "base/metrics/histogram_base.h"
10 #include "base/metrics/histogram_samples.h" 10 #include "base/metrics/histogram_samples.h"
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 browser(), 1368 browser(),
1369 GURL(chrome::kChromeUINewTabURL), 1369 GURL(chrome::kChromeUINewTabURL),
1370 NEW_FOREGROUND_TAB, 1370 NEW_FOREGROUND_TAB,
1371 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 1371 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
1372 EXPECT_EQ(2, browser()->tab_strip_model()->count()); 1372 EXPECT_EQ(2, browser()->tab_strip_model()->count());
1373 1373
1374 // Make sure new tab received the onmostvisitedchanged event once. 1374 // Make sure new tab received the onmostvisitedchanged event once.
1375 content::WebContents* active_tab = 1375 content::WebContents* active_tab =
1376 browser()->tab_strip_model()->GetActiveWebContents(); 1376 browser()->tab_strip_model()->GetActiveWebContents();
1377 EXPECT_TRUE(UpdateSearchState(active_tab)); 1377 EXPECT_TRUE(UpdateSearchState(active_tab));
1378 EXPECT_EQ(2, on_most_visited_change_calls_); 1378 EXPECT_EQ(1, on_most_visited_change_calls_);
1379 1379
1380 // Activate the previous tab. 1380 // Activate the previous tab.
1381 browser()->tab_strip_model()->ActivateTabAt(0, false); 1381 browser()->tab_strip_model()->ActivateTabAt(0, false);
1382 1382
1383 // Switch back to new tab. 1383 // Switch back to new tab.
1384 browser()->tab_strip_model()->ActivateTabAt(1, false); 1384 browser()->tab_strip_model()->ActivateTabAt(1, false);
1385 1385
1386 // Confirm that new tab got no onmostvisitedchanged event. 1386 // Confirm that new tab got no onmostvisitedchanged event.
1387 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); 1387 active_tab = browser()->tab_strip_model()->GetActiveWebContents();
1388 EXPECT_TRUE(UpdateSearchState(active_tab)); 1388 EXPECT_TRUE(UpdateSearchState(active_tab));
1389 EXPECT_EQ(2, on_most_visited_change_calls_); 1389 EXPECT_EQ(1, on_most_visited_change_calls_);
1390 } 1390 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698