| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "core/frame/Deprecation.h" | 5 #include "core/frame/Deprecation.h" |
| 6 #include "core/frame/FrameHost.h" | 6 #include "core/frame/FrameHost.h" |
| 7 #include "core/frame/UseCounter.h" | 7 #include "core/frame/UseCounter.h" |
| 8 #include "core/testing/DummyPageHolder.h" | 8 #include "core/testing/DummyPageHolder.h" |
| 9 #include "platform/testing/HistogramTester.h" | 9 #include "platform/testing/HistogramTester.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 // None of this should update any of the SVG histograms | 185 // None of this should update any of the SVG histograms |
| 186 histogramTester.expectTotalCount(kSVGFeaturesHistogramName, 0); | 186 histogramTester.expectTotalCount(kSVGFeaturesHistogramName, 0); |
| 187 histogramTester.expectTotalCount(kSVGCSSHistogramName, 0); | 187 histogramTester.expectTotalCount(kSVGCSSHistogramName, 0); |
| 188 } | 188 } |
| 189 | 189 |
| 190 TEST(UseCounterTest, SVGImageContext) { | 190 TEST(UseCounterTest, SVGImageContext) { |
| 191 UseCounter useCounter(UseCounter::SVGImageContext); | 191 UseCounter useCounter(UseCounter::SVGImageContext); |
| 192 HistogramTester histogramTester; | 192 HistogramTester histogramTester; |
| 193 | 193 |
| 194 // Verify that SVGImage related feature counters get recorded in a separate hi
stogram. | 194 // Verify that SVGImage related feature counters get recorded in a separate |
| 195 // histogram. |
| 195 EXPECT_FALSE( | 196 EXPECT_FALSE( |
| 196 useCounter.hasRecordedMeasurement(UseCounter::SVGSMILAdditiveAnimation)); | 197 useCounter.hasRecordedMeasurement(UseCounter::SVGSMILAdditiveAnimation)); |
| 197 useCounter.recordMeasurement(UseCounter::SVGSMILAdditiveAnimation); | 198 useCounter.recordMeasurement(UseCounter::SVGSMILAdditiveAnimation); |
| 198 EXPECT_TRUE( | 199 EXPECT_TRUE( |
| 199 useCounter.hasRecordedMeasurement(UseCounter::SVGSMILAdditiveAnimation)); | 200 useCounter.hasRecordedMeasurement(UseCounter::SVGSMILAdditiveAnimation)); |
| 200 histogramTester.expectUniqueSample(kSVGFeaturesHistogramName, | 201 histogramTester.expectUniqueSample(kSVGFeaturesHistogramName, |
| 201 UseCounter::SVGSMILAdditiveAnimation, 1); | 202 UseCounter::SVGSMILAdditiveAnimation, 1); |
| 202 | 203 |
| 203 // And for the CSS counters | 204 // And for the CSS counters |
| 204 EXPECT_FALSE(useCounter.isCounted(CSSPropertyFont)); | 205 EXPECT_FALSE(useCounter.isCounted(CSSPropertyFont)); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 324 |
| 324 m_deprecation.unmuteForInspector(); | 325 m_deprecation.unmuteForInspector(); |
| 325 Deprecation::warnOnDeprecatedProperties(frame(), property); | 326 Deprecation::warnOnDeprecatedProperties(frame(), property); |
| 326 // TODO: use the actually deprecated property to get a deprecation message. | 327 // TODO: use the actually deprecated property to get a deprecation message. |
| 327 EXPECT_FALSE(m_deprecation.isSuppressed(property)); | 328 EXPECT_FALSE(m_deprecation.isSuppressed(property)); |
| 328 Deprecation::countDeprecation(frame(), feature); | 329 Deprecation::countDeprecation(frame(), feature); |
| 329 EXPECT_TRUE(m_useCounter.hasRecordedMeasurement(feature)); | 330 EXPECT_TRUE(m_useCounter.hasRecordedMeasurement(feature)); |
| 330 } | 331 } |
| 331 | 332 |
| 332 } // namespace blink | 333 } // namespace blink |
| OLD | NEW |