| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |