| OLD | NEW |
| 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 Loading... |
| 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_TRUE(histogram_customizer_.IsAlexaTop10NonGoogleSite("www.amazon.de")); |
| 85 EXPECT_TRUE(histogram_customizer_.IsAlexaTop10NonGoogleSite("amazon.de")); |
| 86 EXPECT_TRUE(histogram_customizer_.IsAlexaTop10NonGoogleSite("amazon.co.uk")); |
| 87 EXPECT_TRUE( |
| 88 histogram_customizer_.IsAlexaTop10NonGoogleSite("jp.wikipedia.org")); |
| 89 EXPECT_TRUE( |
| 90 histogram_customizer_.IsAlexaTop10NonGoogleSite("www.facebook.com")); |
| 91 EXPECT_FALSE(histogram_customizer_.IsAlexaTop10NonGoogleSite("")); |
| 92 EXPECT_FALSE( |
| 93 histogram_customizer_.IsAlexaTop10NonGoogleSite("www.google.com")); |
| 94 EXPECT_FALSE(histogram_customizer_.IsAlexaTop10NonGoogleSite("madeup")); |
| 95 } |
| 96 |
| 83 } // namespace content | 97 } // namespace content |
| OLD | NEW |