| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/html/HTMLDimension.h" | 31 #include "core/html/HTMLDimension.h" |
| 32 | 32 |
| 33 #include "platform/wtf/text/WTFString.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 34 #include "testing/gtest/include/gtest/gtest.h" |
| 34 #include "wtf/text/WTFString.h" | |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 // This assertion-prettify function needs to be in the blink namespace. | 38 // This assertion-prettify function needs to be in the blink namespace. |
| 39 void PrintTo(const HTMLDimension& dimension, ::std::ostream* os) { | 39 void PrintTo(const HTMLDimension& dimension, ::std::ostream* os) { |
| 40 *os << "HTMLDimension => type: " << dimension.GetType() | 40 *os << "HTMLDimension => type: " << dimension.GetType() |
| 41 << ", value=" << dimension.Value(); | 41 << ", value=" << dimension.Value(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 TEST(HTMLDimensionTest, parseListOfDimensionsEmptyString) { | 44 TEST(HTMLDimensionTest, parseListOfDimensionsEmptyString) { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 EXPECT_FALSE(ParseDimensionValue(String(".50"), dimension)); | 266 EXPECT_FALSE(ParseDimensionValue(String(".50"), dimension)); |
| 267 } | 267 } |
| 268 | 268 |
| 269 TEST(HTMLDimensionTest, parseDimensionValueInvalidNumberFormatExponent) { | 269 TEST(HTMLDimensionTest, parseDimensionValueInvalidNumberFormatExponent) { |
| 270 HTMLDimension dimension; | 270 HTMLDimension dimension; |
| 271 EXPECT_TRUE(ParseDimensionValue(String("10e10"), dimension)); | 271 EXPECT_TRUE(ParseDimensionValue(String("10e10"), dimension)); |
| 272 EXPECT_EQ(HTMLDimension(10, HTMLDimension::kAbsolute), dimension); | 272 EXPECT_EQ(HTMLDimension(10, HTMLDimension::kAbsolute), dimension); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace blink | 275 } // namespace blink |
| OLD | NEW |