| 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 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 browser(), | 1341 browser(), |
| 1342 GURL(chrome::kChromeUINewTabURL), | 1342 GURL(chrome::kChromeUINewTabURL), |
| 1343 NEW_FOREGROUND_TAB, | 1343 NEW_FOREGROUND_TAB, |
| 1344 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | 1344 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
| 1345 EXPECT_EQ(2, browser()->tab_strip_model()->count()); | 1345 EXPECT_EQ(2, browser()->tab_strip_model()->count()); |
| 1346 | 1346 |
| 1347 // Make sure new tab received the onmostvisitedchanged event once. | 1347 // Make sure new tab received the onmostvisitedchanged event once. |
| 1348 content::WebContents* active_tab = | 1348 content::WebContents* active_tab = |
| 1349 browser()->tab_strip_model()->GetActiveWebContents(); | 1349 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1350 EXPECT_TRUE(UpdateSearchState(active_tab)); | 1350 EXPECT_TRUE(UpdateSearchState(active_tab)); |
| 1351 EXPECT_EQ(2, on_most_visited_change_calls_); | 1351 EXPECT_EQ(1, on_most_visited_change_calls_); |
| 1352 | 1352 |
| 1353 // Activate the previous tab. | 1353 // Activate the previous tab. |
| 1354 browser()->tab_strip_model()->ActivateTabAt(0, false); | 1354 browser()->tab_strip_model()->ActivateTabAt(0, false); |
| 1355 | 1355 |
| 1356 // Switch back to new tab. | 1356 // Switch back to new tab. |
| 1357 browser()->tab_strip_model()->ActivateTabAt(1, false); | 1357 browser()->tab_strip_model()->ActivateTabAt(1, false); |
| 1358 | 1358 |
| 1359 // Confirm that new tab got no onmostvisitedchanged event. | 1359 // Confirm that new tab got no onmostvisitedchanged event. |
| 1360 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 1360 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 1361 EXPECT_TRUE(UpdateSearchState(active_tab)); | 1361 EXPECT_TRUE(UpdateSearchState(active_tab)); |
| 1362 EXPECT_EQ(2, on_most_visited_change_calls_); | 1362 EXPECT_EQ(1, on_most_visited_change_calls_); |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 IN_PROC_BROWSER_TEST_F(InstantPolicyTest, ThemeBackgroundAccess) { | 1365 IN_PROC_BROWSER_TEST_F(InstantPolicyTest, ThemeBackgroundAccess) { |
| 1366 InstallThemeSource(); | 1366 InstallThemeSource(); |
| 1367 ASSERT_NO_FATAL_FAILURE(InstallThemeAndVerify("theme", "camo theme")); | 1367 ASSERT_NO_FATAL_FAILURE(InstallThemeAndVerify("theme", "camo theme")); |
| 1368 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 1368 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 1369 FocusOmniboxAndWaitForInstantNTPSupport(); | 1369 FocusOmniboxAndWaitForInstantNTPSupport(); |
| 1370 | 1370 |
| 1371 // The "Instant" New Tab should have access to chrome-search: scheme but not | 1371 // The "Instant" New Tab should have access to chrome-search: scheme but not |
| 1372 // chrome: scheme. | 1372 // chrome: scheme. |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1637 content::WindowedNotificationObserver load_stop_observer_2( | 1637 content::WindowedNotificationObserver load_stop_observer_2( |
| 1638 content::NOTIFICATION_LOAD_STOP, | 1638 content::NOTIFICATION_LOAD_STOP, |
| 1639 content::Source<content::NavigationController>( | 1639 content::Source<content::NavigationController>( |
| 1640 &active_tab->GetController())); | 1640 &active_tab->GetController())); |
| 1641 active_tab->GetController().GoBack(); | 1641 active_tab->GetController().GoBack(); |
| 1642 load_stop_observer_2.Wait(); | 1642 load_stop_observer_2.Wait(); |
| 1643 | 1643 |
| 1644 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 1644 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 1645 EXPECT_TRUE(chrome::IsInstantNTP(active_tab)); | 1645 EXPECT_TRUE(chrome::IsInstantNTP(active_tab)); |
| 1646 } | 1646 } |
| OLD | NEW |