| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef RuntimeEnabledFeaturesTestHelpers_h | 5 #ifndef RuntimeEnabledFeaturesTestHelpers_h |
| 6 #define RuntimeEnabledFeaturesTestHelpers_h | 6 #define RuntimeEnabledFeaturesTestHelpers_h |
| 7 | 7 |
| 8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "wtf/Assertions.h" | 9 #include "platform/wtf/Assertions.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 template <bool (&getter)(), void (&setter)(bool)> | 13 template <bool (&getter)(), void (&setter)(bool)> |
| 14 class ScopedRuntimeEnabledFeatureForTest { | 14 class ScopedRuntimeEnabledFeatureForTest { |
| 15 public: | 15 public: |
| 16 ScopedRuntimeEnabledFeatureForTest(bool enabled) | 16 ScopedRuntimeEnabledFeatureForTest(bool enabled) |
| 17 : m_enabled(enabled), m_original(getter()) { | 17 : m_enabled(enabled), m_original(getter()) { |
| 18 setter(enabled); | 18 setter(enabled); |
| 19 } | 19 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 RuntimeEnabledFeatures::setSlimmingPaintInvalidationEnabled> | 53 RuntimeEnabledFeatures::setSlimmingPaintInvalidationEnabled> |
| 54 ScopedSlimmingPaintInvalidationForTest; | 54 ScopedSlimmingPaintInvalidationForTest; |
| 55 typedef ScopedRuntimeEnabledFeatureForTest< | 55 typedef ScopedRuntimeEnabledFeatureForTest< |
| 56 RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled, | 56 RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled, |
| 57 RuntimeEnabledFeatures::setPaintUnderInvalidationCheckingEnabled> | 57 RuntimeEnabledFeatures::setPaintUnderInvalidationCheckingEnabled> |
| 58 ScopedPaintUnderInvalidationCheckingForTest; | 58 ScopedPaintUnderInvalidationCheckingForTest; |
| 59 | 59 |
| 60 } // namespace blink | 60 } // namespace blink |
| 61 | 61 |
| 62 #endif // RuntimeEnabledFeaturesTestHelpers_h | 62 #endif // RuntimeEnabledFeaturesTestHelpers_h |
| OLD | NEW |