| OLD | NEW |
| 1 // Use of this source code is governed by a BSD-style license that can be | 1 // Use of this source code is governed by a BSD-style license that can be |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/MediaValues.h" | 5 #include "core/css/MediaValues.h" |
| 6 | 6 |
| 7 #include "core/css/CSSPrimitiveValue.h" | 7 #include "core/css/CSSPrimitiveValue.h" |
| 8 #include "platform/wtf/text/StringBuilder.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "wtf/text/StringBuilder.h" | |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 struct TestCase { | 13 struct TestCase { |
| 14 double value; | 14 double value; |
| 15 CSSPrimitiveValue::UnitType type; | 15 CSSPrimitiveValue::UnitType type; |
| 16 unsigned font_size; | 16 unsigned font_size; |
| 17 unsigned viewport_width; | 17 unsigned viewport_width; |
| 18 unsigned viewport_height; | 18 unsigned viewport_height; |
| 19 bool success; | 19 bool success; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 bool success = MediaValues::ComputeLength( | 55 bool success = MediaValues::ComputeLength( |
| 56 test_cases[i].value, test_cases[i].type, test_cases[i].font_size, | 56 test_cases[i].value, test_cases[i].type, test_cases[i].font_size, |
| 57 test_cases[i].viewport_width, test_cases[i].viewport_height, output); | 57 test_cases[i].viewport_width, test_cases[i].viewport_height, output); |
| 58 EXPECT_EQ(test_cases[i].success, success); | 58 EXPECT_EQ(test_cases[i].success, success); |
| 59 if (success) | 59 if (success) |
| 60 EXPECT_FLOAT_EQ(test_cases[i].output, output); | 60 EXPECT_FLOAT_EQ(test_cases[i].output, output); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |