| Index: chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
|
| diff --git a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
|
| index 1b52ea8f37126e974d13ff08f527fb609c81d5e5..f19bafa3d18feb22d6eb94c6aacbb67c0f5fd83e 100644
|
| --- a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
|
| +++ b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
|
| @@ -19,7 +19,6 @@
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_navigator_params.h"
|
| #include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| -#include "chrome/common/page_load_metrics/page_load_metrics_messages.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| @@ -39,6 +38,19 @@
|
|
|
| namespace {
|
|
|
| +void FailAllNetworkTransactions(net::URLRequestContextGetter* getter) {
|
| + DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
| + net::HttpCache* cache(
|
| + getter->GetURLRequestContext()->http_transaction_factory()->GetCache());
|
| + DCHECK(cache);
|
| + std::unique_ptr<net::FailingHttpTransactionFactory> factory(
|
| + new net::FailingHttpTransactionFactory(cache->GetSession(),
|
| + net::ERR_FAILED));
|
| + // Throw away old version; since this is a browser test, there is no
|
| + // need to restore the old state.
|
| + cache->SetHttpNetworkTransactionFactoryForTesting(std::move(factory));
|
| +}
|
| +
|
| // Waits until specified timing and metadata expectations are satisfied.
|
| class PageLoadMetricsWaiter
|
| : public page_load_metrics::MetricsWebContentsObserver::TestingObserver {
|
| @@ -148,19 +160,6 @@ class PageLoadMetricsBrowserTest : public InProcessBrowserTest {
|
| DISALLOW_COPY_AND_ASSIGN(PageLoadMetricsBrowserTest);
|
| };
|
|
|
| -void FailAllNetworkTransactions(net::URLRequestContextGetter* getter) {
|
| - DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
| - net::HttpCache* cache(
|
| - getter->GetURLRequestContext()->http_transaction_factory()->GetCache());
|
| - DCHECK(cache);
|
| - std::unique_ptr<net::FailingHttpTransactionFactory> factory(
|
| - new net::FailingHttpTransactionFactory(cache->GetSession(),
|
| - net::ERR_FAILED));
|
| - // Throw away old version; since this is a browser test, there is no
|
| - // need to restore the old state.
|
| - cache->SetHttpNetworkTransactionFactoryForTesting(std::move(factory));
|
| -}
|
| -
|
| IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NoNavigation) {
|
| ASSERT_TRUE(embedded_test_server()->Start());
|
| EXPECT_TRUE(NoPageLoadMetricsRecorded());
|
|
|