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

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

Issue 1317263004: Added some browsertests to PageLoadMetrics change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hijack_bryans_cl
Patch Set: updated histogram names Created 5 years, 2 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 | no next file » | 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/test/histogram_tester.h" 5 #include "base/test/histogram_tester.h"
6 #include "chrome/test/base/in_process_browser_test.h" 6 #include "chrome/test/base/in_process_browser_test.h"
7 #include "chrome/test/base/ui_test_utils.h" 7 #include "chrome/test/base/ui_test_utils.h"
8 #include "net/test/spawned_test_server/spawned_test_server.h" 8 #include "net/test/spawned_test_server/spawned_test_server.h"
9 9
10 namespace page_load_metrics { 10 namespace page_load_metrics {
11 11
12 class MetricsWebContentsObserverBrowserTest : public InProcessBrowserTest { 12 class MetricsWebContentsObserverBrowserTest : public InProcessBrowserTest {
13 public: 13 public:
14 const char* kHistogramNameFirstLayout = 14 const char* kHistogramNameFirstLayout =
15 "PageLoad.Timing.NavigationToFirstLayout"; 15 "PageLoad.Timing2.NavigationToFirstLayout";
16 const char* kHistogramNameDomContent = 16 const char* kHistogramNameDomContent =
17 "PageLoad.Timing.NavigationToDOMContentLoadedEventFired"; 17 "PageLoad.Timing2.NavigationToDOMContentLoadedEventFired";
18 const char* kHistogramNameLoad = "PageLoad.Timing.NavigationToLoadEventFired"; 18 const char* kHistogramNameLoad =
19 "PageLoad.Timing2.NavigationToLoadEventFired";
19 MetricsWebContentsObserverBrowserTest() {}; 20 MetricsWebContentsObserverBrowserTest() {};
20 ~MetricsWebContentsObserverBrowserTest() override {}; 21 ~MetricsWebContentsObserverBrowserTest() override {};
21 22
22 protected: 23 protected:
23 base::HistogramTester histogram_tester_; 24 base::HistogramTester histogram_tester_;
24 25
25 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserverBrowserTest); 26 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserverBrowserTest);
26 }; 27 };
27 28
28 IN_PROC_BROWSER_TEST_F(MetricsWebContentsObserverBrowserTest, NoNavigation) { 29 IN_PROC_BROWSER_TEST_F(MetricsWebContentsObserverBrowserTest, NoNavigation) {
(...skipping 26 matching lines...) Expand all
55 test_server()->GetURL("/title1.html#hash")); 56 test_server()->GetURL("/title1.html#hash"));
56 ui_test_utils::NavigateToURL(browser(), 57 ui_test_utils::NavigateToURL(browser(),
57 test_server()->GetURL("/title2.html")); 58 test_server()->GetURL("/title2.html"));
58 59
59 histogram_tester_.ExpectTotalCount(kHistogramNameDomContent, 1); 60 histogram_tester_.ExpectTotalCount(kHistogramNameDomContent, 1);
60 histogram_tester_.ExpectTotalCount(kHistogramNameLoad, 1); 61 histogram_tester_.ExpectTotalCount(kHistogramNameLoad, 1);
61 histogram_tester_.ExpectTotalCount(kHistogramNameFirstLayout, 1); 62 histogram_tester_.ExpectTotalCount(kHistogramNameFirstLayout, 1);
62 } 63 }
63 64
64 } // namespace page_load_metrics 65 } // namespace page_load_metrics
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698