| Index: chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc
|
| diff --git a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc
|
| index 7ef0dc15033c04b2513846e4c0dda3ca9d921b07..eb6b6c48eaacb8d3f9fd341db4b65ccdc6408c9c 100644
|
| --- a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc
|
| +++ b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc
|
| @@ -152,12 +152,12 @@ TEST_F(CorePageLoadMetricsObserverTest, BackgroundDifferentHistogram) {
|
| timing.first_layout = first_layout;
|
|
|
| // Simulate "Open link in new tab."
|
| - web_contents()->WasHidden();
|
| + SimulateHide();
|
| NavigateAndCommit(GURL(kDefaultTestUrl));
|
| SimulateTimingUpdate(timing);
|
|
|
| // Simulate switching to the tab and making another navigation.
|
| - web_contents()->WasShown();
|
| + SimulateShow();
|
| AssertNoHistogramsLogged();
|
|
|
| // Navigate again to force histogram recording.
|
| @@ -194,8 +194,8 @@ TEST_F(CorePageLoadMetricsObserverTest, OnlyBackgroundLaterEvents) {
|
| SimulateTimingUpdate(timing);
|
|
|
| // Background the tab, then forground it.
|
| - web_contents()->WasHidden();
|
| - web_contents()->WasShown();
|
| + SimulateHide();
|
| + SimulateShow();
|
| timing.first_layout = base::TimeDelta::FromSeconds(3);
|
| timing.first_text_paint = base::TimeDelta::FromSeconds(4);
|
| SimulateTimingUpdate(timing);
|
| @@ -237,13 +237,13 @@ TEST_F(CorePageLoadMetricsObserverTest, DontBackgroundQuickerLoad) {
|
| timing.navigation_start = base::Time::FromDoubleT(1);
|
| timing.first_layout = first_layout;
|
|
|
| - web_contents()->WasHidden();
|
| + SimulateHide();
|
|
|
| // Open in new tab
|
| StartNavigation(GURL(kDefaultTestUrl));
|
|
|
| // Switch to the tab
|
| - web_contents()->WasShown();
|
| + SimulateShow();
|
|
|
| // Start another provisional load
|
| StartNavigation(GURL(kDefaultTestUrl2));
|
| @@ -289,7 +289,7 @@ TEST_F(CorePageLoadMetricsObserverTest, FailedBackgroundProvisionalLoad) {
|
| content::RenderFrameHostTester* rfh_tester =
|
| content::RenderFrameHostTester::For(main_rfh());
|
| rfh_tester->SimulateNavigationStart(url);
|
| - web_contents()->WasHidden();
|
| + SimulateHide();
|
| rfh_tester->SimulateNavigationError(url, net::ERR_TIMED_OUT);
|
| rfh_tester->SimulateNavigationStop();
|
|
|
| @@ -303,10 +303,10 @@ TEST_F(CorePageLoadMetricsObserverTest, BackgroundBeforePaint) {
|
| timing.first_paint = base::TimeDelta::FromSeconds(10);
|
| NavigateAndCommit(GURL(kDefaultTestUrl));
|
| // Background the tab and go for a coffee or something.
|
| - web_contents()->WasHidden();
|
| + SimulateHide();
|
| SimulateTimingUpdate(timing);
|
| // Come back and start browsing again.
|
| - web_contents()->WasShown();
|
| + SimulateShow();
|
| // Simulate the user performaning another navigation.
|
| NavigateAndCommit(GURL("https://www.example.com"));
|
| histogram_tester().ExpectTotalCount(internal::kHistogramBackgroundBeforePaint,
|
|
|