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

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: Rebase 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 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 browser(), 2878 browser(),
2879 GURL(chrome::kChromeUINewTabURL), 2879 GURL(chrome::kChromeUINewTabURL),
2880 NEW_FOREGROUND_TAB, 2880 NEW_FOREGROUND_TAB,
2881 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 2881 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
2882 EXPECT_EQ(2, browser()->tab_strip_model()->count()); 2882 EXPECT_EQ(2, browser()->tab_strip_model()->count());
2883 2883
2884 // Make sure new tab received the onmostvisitedchanged event once. 2884 // Make sure new tab received the onmostvisitedchanged event once.
2885 content::WebContents* active_tab = 2885 content::WebContents* active_tab =
2886 browser()->tab_strip_model()->GetActiveWebContents(); 2886 browser()->tab_strip_model()->GetActiveWebContents();
2887 EXPECT_TRUE(UpdateSearchState(active_tab)); 2887 EXPECT_TRUE(UpdateSearchState(active_tab));
2888 EXPECT_EQ(2, on_most_visited_change_calls_); 2888 EXPECT_EQ(1, on_most_visited_change_calls_);
2889 2889
2890 // Activate the previous tab. 2890 // Activate the previous tab.
2891 browser()->tab_strip_model()->ActivateTabAt(0, false); 2891 browser()->tab_strip_model()->ActivateTabAt(0, false);
2892 2892
2893 // Switch back to new tab. 2893 // Switch back to new tab.
2894 browser()->tab_strip_model()->ActivateTabAt(1, false); 2894 browser()->tab_strip_model()->ActivateTabAt(1, false);
2895 2895
2896 // Confirm that new tab got no onmostvisitedchanged event. 2896 // Confirm that new tab got no onmostvisitedchanged event.
2897 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); 2897 active_tab = browser()->tab_strip_model()->GetActiveWebContents();
2898 EXPECT_TRUE(UpdateSearchState(active_tab)); 2898 EXPECT_TRUE(UpdateSearchState(active_tab));
2899 EXPECT_EQ(2, on_most_visited_change_calls_); 2899 EXPECT_EQ(1, on_most_visited_change_calls_);
2900 } 2900 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698