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

Side by Side Diff: components/navigation_metrics/navigation_metrics_unittest.cc

Issue 2713273002: Increase test coverage for Navigation.MainFrameSchemeDifferentPage (Closed)
Patch Set: Increase test coverage for Navigation.MainFrameSchemeDifferentPage Created 3 years, 9 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 | « components/navigation_metrics/BUILD.gn ('k') | 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/navigation_metrics/navigation_metrics.h"
6
7 #include "base/test/histogram_tester.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/gurl.h"
10
11 namespace {
12 const char* const kTestUrl = "http://www.example.com";
13 const char* const kMainFrameScheme = "Navigation.MainFrameScheme";
14 const char* const kMainFrameSchemeDifferentPage =
15 "Navigation.MainFrameSchemeDifferentPage";
16
17 } // namespace
18
19 namespace navigation_metrics {
20
21 TEST(NavigationMetrics, MainFrameSchemeDifferentPage) {
22 base::HistogramTester test;
23
24 RecordMainFrameNavigation(GURL(kTestUrl), false, false, false);
25
26 test.ExpectTotalCount(kMainFrameScheme, 1);
27 test.ExpectUniqueSample(kMainFrameScheme, 1 /* http */, 1);
28 test.ExpectTotalCount(kMainFrameSchemeDifferentPage, 1);
29 test.ExpectUniqueSample(kMainFrameSchemeDifferentPage, 1 /* http */, 1);
30 }
31
32 TEST(NavigationMetrics, MainFrameSchemeSamePage) {
33 base::HistogramTester test;
34
35 RecordMainFrameNavigation(GURL(kTestUrl), true, false, false);
36
37 test.ExpectTotalCount(kMainFrameScheme, 1);
38 test.ExpectUniqueSample(kMainFrameScheme, 1 /* http */, 1);
39 test.ExpectTotalCount(kMainFrameSchemeDifferentPage, 0);
40 }
41
42 } // namespace navigation_metrics
OLDNEW
« no previous file with comments | « components/navigation_metrics/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698