| 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 #include "core/css/cssom/CSSStyleImageValue.h" | 5 #include "core/css/cssom/CSSStyleImageValue.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 namespace cssom { |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 class FakeCSSStyleImageValue : public CSSStyleImageValue { | 14 class FakeCSSStyleImageValue : public CSSStyleImageValue { |
| 14 public: | 15 public: |
| 15 FakeCSSStyleImageValue(CSSImageValue* imageValue, bool cachePending, LayoutS
ize layoutSize) | 16 FakeCSSStyleImageValue(CSSImageValue* imageValue, bool cachePending, LayoutS
ize layoutSize) |
| 16 : CSSStyleImageValue(imageValue) | 17 : CSSStyleImageValue(imageValue) |
| 17 , m_cachePending(cachePending) | 18 , m_cachePending(cachePending) |
| 18 , m_layoutSize(layoutSize) | 19 , m_layoutSize(layoutSize) |
| 19 { | 20 { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 44 FakeCSSStyleImageValue* styleImageValue = new FakeCSSStyleImageValue(CSSImag
eValue::create(""), false, LayoutSize(480, 120)); | 45 FakeCSSStyleImageValue* styleImageValue = new FakeCSSStyleImageValue(CSSImag
eValue::create(""), false, LayoutSize(480, 120)); |
| 45 bool isNull; | 46 bool isNull; |
| 46 EXPECT_EQ(styleImageValue->intrinsicWidth(isNull), 480); | 47 EXPECT_EQ(styleImageValue->intrinsicWidth(isNull), 480); |
| 47 EXPECT_EQ(styleImageValue->intrinsicHeight(isNull), 120); | 48 EXPECT_EQ(styleImageValue->intrinsicHeight(isNull), 120); |
| 48 EXPECT_EQ(styleImageValue->intrinsicRatio(isNull), 4); | 49 EXPECT_EQ(styleImageValue->intrinsicRatio(isNull), 4); |
| 49 EXPECT_FALSE(isNull); | 50 EXPECT_FALSE(isNull); |
| 50 } | 51 } |
| 51 | 52 |
| 52 } // namespace | 53 } // namespace |
| 53 | 54 |
| 55 } // namespace cssom |
| 54 } // namespace blink | 56 } // namespace blink |
| 57 |
| OLD | NEW |