| 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/CSSURLImageValue.h" | 5 #include "core/css/cssom/CSSURLImageValue.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 void checkNullURLImageValue(CSSURLImageValue* urlImageValue) | 14 void checkNullURLImageValue(CSSURLImageValue* urlImageValue) |
| 14 { | 15 { |
| 15 EXPECT_EQ(urlImageValue->state(), "unloaded"); | 16 EXPECT_EQ(urlImageValue->state(), "unloaded"); |
| 16 bool isNull; | 17 bool isNull; |
| 17 EXPECT_EQ(urlImageValue->intrinsicWidth(isNull), 0); | 18 EXPECT_EQ(urlImageValue->intrinsicWidth(isNull), 0); |
| 18 EXPECT_EQ(urlImageValue->intrinsicHeight(isNull), 0); | 19 EXPECT_EQ(urlImageValue->intrinsicHeight(isNull), 0); |
| 19 EXPECT_EQ(urlImageValue->intrinsicRatio(isNull), 0); | 20 EXPECT_EQ(urlImageValue->intrinsicRatio(isNull), 0); |
| 20 EXPECT_TRUE(isNull); | 21 EXPECT_TRUE(isNull); |
| 21 } | 22 } |
| 22 | 23 |
| 23 TEST(CSSURLImageValueTest, CreateURLImageValueFromURL) | 24 TEST(CSSURLImageValueTest, CreateURLImageValueFromURL) |
| 24 { | 25 { |
| 25 checkNullURLImageValue(CSSURLImageValue::create("http://localhost")); | 26 checkNullURLImageValue(CSSURLImageValue::create("http://localhost")); |
| 26 } | 27 } |
| 27 | 28 |
| 28 TEST(CSSURLImageValueTest, CreateURLImageValueFromImageValue) | 29 TEST(CSSURLImageValueTest, CreateURLImageValueFromImageValue) |
| 29 { | 30 { |
| 30 checkNullURLImageValue(CSSURLImageValue::create(CSSImageValue::create("http:
//localhost"))); | 31 checkNullURLImageValue(CSSURLImageValue::create(CSSImageValue::create("http:
//localhost"))); |
| 31 } | 32 } |
| 32 | 33 |
| 33 } // namespace | 34 } // namespace |
| 34 | 35 |
| 36 } // namespace cssom |
| 35 } // namespace blink | 37 } // namespace blink |
| 38 |
| OLD | NEW |