| 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/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
| 9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 ui_test_utils::NavigateToURLWithDisposition( | 450 ui_test_utils::NavigateToURLWithDisposition( |
| 451 browser(), | 451 browser(), |
| 452 GURL(chrome::kChromeUINewTabURL), | 452 GURL(chrome::kChromeUINewTabURL), |
| 453 NEW_FOREGROUND_TAB, | 453 NEW_FOREGROUND_TAB, |
| 454 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | 454 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
| 455 content::WebContents* active_tab = | 455 content::WebContents* active_tab = |
| 456 browser()->tab_strip_model()->GetActiveWebContents(); | 456 browser()->tab_strip_model()->GetActiveWebContents(); |
| 457 EXPECT_NE(ntp_url, active_tab->GetURL()); | 457 EXPECT_NE(ntp_url, active_tab->GetURL()); |
| 458 } | 458 } |
| 459 | 459 |
| 460 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PreloadedNTPRenderViewGone) { | 460 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PreloadedNTPRenderProcessGone) { |
| 461 // Setup Instant. | 461 // Setup Instant. |
| 462 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 462 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 463 FocusOmniboxAndWaitForInstantNTPSupport(); | 463 FocusOmniboxAndWaitForInstantNTPSupport(); |
| 464 | 464 |
| 465 // NTP contents should be preloaded. | 465 // NTP contents should be preloaded. |
| 466 ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp()); | 466 ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp()); |
| 467 EXPECT_FALSE(instant()->ntp()->IsLocal()); | 467 EXPECT_FALSE(instant()->ntp()->IsLocal()); |
| 468 | 468 |
| 469 // NTP not reloaded after being killed. | 469 // NTP not reloaded after being killed. |
| 470 instant()->InstantPageRenderViewGone(instant()->ntp()->contents()); | 470 instant()->InstantPageRenderProcessGone(instant()->ntp()->contents()); |
| 471 EXPECT_EQ(NULL, instant()->ntp()); | 471 EXPECT_EQ(NULL, instant()->ntp()); |
| 472 | 472 |
| 473 // Open new tab. Should use local NTP. | 473 // Open new tab. Should use local NTP. |
| 474 ui_test_utils::NavigateToURLWithDisposition( | 474 ui_test_utils::NavigateToURLWithDisposition( |
| 475 browser(), | 475 browser(), |
| 476 GURL(chrome::kChromeUINewTabURL), | 476 GURL(chrome::kChromeUINewTabURL), |
| 477 NEW_FOREGROUND_TAB, | 477 NEW_FOREGROUND_TAB, |
| 478 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | 478 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
| 479 content::WebContents* active_tab = | 479 content::WebContents* active_tab = |
| 480 browser()->tab_strip_model()->GetActiveWebContents(); | 480 browser()->tab_strip_model()->GetActiveWebContents(); |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 EXPECT_TRUE(active_tab->GetController().CanGoBack()); | 1768 EXPECT_TRUE(active_tab->GetController().CanGoBack()); |
| 1769 active_tab->GetController().GoBack(); | 1769 active_tab->GetController().GoBack(); |
| 1770 back_observer.Wait(); | 1770 back_observer.Wait(); |
| 1771 | 1771 |
| 1772 // Verify that onmostvisitedchange event is dispatched when we navigate from | 1772 // Verify that onmostvisitedchange event is dispatched when we navigate from |
| 1773 // SRP to NTP. | 1773 // SRP to NTP. |
| 1774 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 1774 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 1775 EXPECT_TRUE(UpdateSearchState(active_tab)); | 1775 EXPECT_TRUE(UpdateSearchState(active_tab)); |
| 1776 EXPECT_EQ(1, on_most_visited_change_calls_); | 1776 EXPECT_EQ(1, on_most_visited_change_calls_); |
| 1777 } | 1777 } |
| OLD | NEW |