Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc

Issue 2345443002: FirstMeaningfulPaint UMA: Reduce the network activity threshold (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/test/histogram_tester.h" 6 #include "base/test/histogram_tester.h"
7 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" 7 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h"
8 #include "chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_ob server.h" 8 #include "chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_ob server.h"
9 #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_obse rver.h" 9 #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_obse rver.h"
10 #include "chrome/browser/page_load_metrics/observers/document_write_page_load_me trics_observer.h" 10 #include "chrome/browser/page_load_metrics/observers/document_write_page_load_me trics_observer.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 382
383 IN_PROC_BROWSER_TEST_F(MetricsWebContentsObserverBrowserTest, 383 IN_PROC_BROWSER_TEST_F(MetricsWebContentsObserverBrowserTest,
384 FirstMeaningfulPaintRecorded) { 384 FirstMeaningfulPaintRecorded) {
385 ASSERT_TRUE(embedded_test_server()->Start()); 385 ASSERT_TRUE(embedded_test_server()->Start());
386 386
387 ui_test_utils::NavigateToURL(browser(), 387 ui_test_utils::NavigateToURL(browser(),
388 embedded_test_server()->GetURL("/title1.html")); 388 embedded_test_server()->GetURL("/title1.html"));
389 389
390 // Wait until the renderer finishes observing layouts. 390 // Wait until the renderer finishes observing layouts.
391 const int kNetworkIdleTime = 2000; 391 const int kNetworkIdleTime = 500;
392 const int kMargin = 500; 392 const int kMargin = 500;
393 const std::string javascript = base::StringPrintf( 393 const std::string javascript = base::StringPrintf(
394 "setTimeout(() => window.domAutomationController.send(true), %d)", 394 "setTimeout(() => window.domAutomationController.send(true), %d)",
395 kNetworkIdleTime + kMargin); 395 kNetworkIdleTime + kMargin);
396 bool result; 396 bool result;
397 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( 397 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
398 browser()->tab_strip_model()->GetActiveWebContents(), 398 browser()->tab_strip_model()->GetActiveWebContents(),
399 javascript, &result)); 399 javascript, &result));
400 EXPECT_TRUE(result); 400 EXPECT_TRUE(result);
401 401
(...skipping 18 matching lines...) Expand all
420 NavigateToUntrackedUrl(); 420 NavigateToUntrackedUrl();
421 421
422 histogram_tester_.ExpectUniqueSample( 422 histogram_tester_.ExpectUniqueSample(
423 internal::kHistogramFirstMeaningfulPaintStatus, 423 internal::kHistogramFirstMeaningfulPaintStatus,
424 internal::FIRST_MEANINGFUL_PAINT_DID_NOT_REACH_NETWORK_STABLE, 1); 424 internal::FIRST_MEANINGFUL_PAINT_DID_NOT_REACH_NETWORK_STABLE, 1);
425 histogram_tester_.ExpectTotalCount( 425 histogram_tester_.ExpectTotalCount(
426 internal::kHistogramFirstMeaningfulPaint, 0); 426 internal::kHistogramFirstMeaningfulPaint, 0);
427 histogram_tester_.ExpectTotalCount( 427 histogram_tester_.ExpectTotalCount(
428 internal::kHistogramParseStartToFirstMeaningfulPaint, 0); 428 internal::kHistogramParseStartToFirstMeaningfulPaint, 0);
429 } 429 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698