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: content/renderer/render_thread_impl_unittest.cc

Issue 1399853004: Collect separate V8 histograms for Top10 non-Google sites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added UnitTests + Reformatted code Created 5 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace content { 10 namespace content {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 histogram_customizer_.ConvertToCustomHistogramName( 73 histogram_customizer_.ConvertToCustomHistogramName(
74 kCustomizableHistogram_)); 74 kCustomizableHistogram_));
75 // After this point, there will never be a custom diagram again, even if the 75 // After this point, there will never be a custom diagram again, even if the
76 // view navigated back to the common host. 76 // view navigated back to the common host.
77 histogram_customizer_.RenderViewNavigatedToHost("mail.google.com", 2); 77 histogram_customizer_.RenderViewNavigatedToHost("mail.google.com", 2);
78 EXPECT_EQ(kCustomizableHistogram_, 78 EXPECT_EQ(kCustomizableHistogram_,
79 histogram_customizer_.ConvertToCustomHistogramName( 79 histogram_customizer_.ConvertToCustomHistogramName(
80 kCustomizableHistogram_)); 80 kCustomizableHistogram_));
81 } 81 }
82 82
83 TEST_F(RenderThreadImplUnittest, IdentifyAlexaTop10NonGoogleSite) {
84 EXPECT_EQ(true,
85 histogram_customizer_.IsAlexaTop10NonGoogleSite("www.amazon.de"));
86 EXPECT_EQ(true, histogram_customizer_.IsAlexaTop10NonGoogleSite("amazon.de"));
87 EXPECT_EQ(true,
88 histogram_customizer_.IsAlexaTop10NonGoogleSite("amazon.co.uk"));
89 EXPECT_EQ(true, histogram_customizer_.IsAlexaTop10NonGoogleSite(
90 "jp.wikipedia.org"));
91 EXPECT_EQ(true, histogram_customizer_.IsAlexaTop10NonGoogleSite(
92 "www.facebook.com"));
93 EXPECT_EQ(false, histogram_customizer_.IsAlexaTop10NonGoogleSite(""));
94 EXPECT_EQ(false,
95 histogram_customizer_.IsAlexaTop10NonGoogleSite("www.google.com"));
96 EXPECT_EQ(false, histogram_customizer_.IsAlexaTop10NonGoogleSite("madeup"));
97 }
98
83 } // namespace content 99 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698