Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/UseCounterTest.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp |
| index 864057a4d9610261007da901009f175b4acc5d36..030f8bc4f4efea4cfbd071499133d2c973421dc7 100644 |
| --- a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp |
| +++ b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp |
| @@ -16,6 +16,8 @@ const char* const kFeaturesHistogramName = "Blink.UseCounter.Features"; |
| const char* const kCSSHistogramName = "Blink.UseCounter.CSSProperties"; |
| const char* const kAnimatedCSSHistogramName = |
| "Blink.UseCounter.AnimatedCSSProperties"; |
| +const char* const kExtensionFeaturesHistogramName = |
|
Rick Byers
2017/04/28 15:04:40
nit: please add this to the unaffected_histograms
|
| + "Blink.UseCounter.Extensions.Features"; |
| const char* const kSVGFeaturesHistogramName = |
| "Blink.UseCounter.SVGImage.Features"; |
| @@ -238,6 +240,23 @@ TEST(UseCounterTest, SVGImageContextAnimatedCSSProperties) { |
| 1 /* page visit bucket */); |
| } |
| +TEST(UseCounterTest, RecordingExtensions) { |
| + UseCounter use_counter(UseCounter::kExtensionContext); |
| + HistogramBasicTest<UseCounter::Feature>( |
| + kExtensionFeaturesHistogramName, kLegacyFeaturesHistogramName, |
| + {kSVGFeaturesHistogramName, kFeaturesHistogramName}, UseCounter::kFetch, |
| + UseCounter::kFetchBodyStream, |
| + [&](UseCounter::Feature feature) -> bool { |
| + return use_counter.HasRecordedMeasurement(feature); |
| + }, |
| + [&](UseCounter::Feature feature) { |
| + use_counter.RecordMeasurement(feature); |
| + }, |
| + [](UseCounter::Feature feature) -> int { return feature; }, |
| + [&](KURL kurl) { use_counter.DidCommitLoad(kurl); }, |
| + "chrome-extension://dummysite", UseCounter::kPageVisits); |
| +} |
| + |
| // Failing on Android: crbug.com/667913 |
| #if OS(ANDROID) |
| #define MAYBE_InspectorDisablesMeasurement DISABLED_InspectorDisablesMeasurement |