| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include <gtest/gtest.h> | 44 #include <gtest/gtest.h> |
| 45 | 45 |
| 46 #define EXPECT_ROUNDTRIP(a, f) EXPECT_REFV_EQ(a, f(a.get())) | 46 #define EXPECT_ROUNDTRIP(a, f) EXPECT_REFV_EQ(a, f(a.get())) |
| 47 | 47 |
| 48 namespace WebCore { | 48 namespace WebCore { |
| 49 | 49 |
| 50 class AnimationAnimatableLengthTest : public ::testing::Test { | 50 class AnimationAnimatableLengthTest : public ::testing::Test { |
| 51 protected: | 51 protected: |
| 52 AnimationAnimatableLengthTest() | 52 AnimationAnimatableLengthTest() |
| 53 : style(RenderStyle::createDefaultStyle()) | 53 : style(RenderStyle::createDefaultStyle()) |
| 54 , conversionDataZoom1(style.get(), style.get(), 1.0f) | 54 , conversionDataZoom1(style.get(), style.get(), 0, 1.0f) |
| 55 , conversionDataZoom3(style.get(), style.get(), 3.0f) | 55 , conversionDataZoom3(style.get(), style.get(), 0, 3.0f) |
| 56 { | 56 { |
| 57 } | 57 } |
| 58 | 58 |
| 59 PassRefPtr<AnimatableLength> create(double value, CSSPrimitiveValue::UnitTyp
es type) | 59 PassRefPtr<AnimatableLength> create(double value, CSSPrimitiveValue::UnitTyp
es type) |
| 60 { | 60 { |
| 61 return AnimatableLength::create(CSSPrimitiveValue::create(value, type).g
et()); | 61 return AnimatableLength::create(CSSPrimitiveValue::create(value, type).g
et()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 PassRefPtr<AnimatableLength> create(double valueLeft, CSSPrimitiveValue::Uni
tTypes typeLeft, double valueRight, CSSPrimitiveValue::UnitTypes typeRight) | 64 PassRefPtr<AnimatableLength> create(double valueLeft, CSSPrimitiveValue::Uni
tTypes typeLeft, double valueRight, CSSPrimitiveValue::UnitTypes typeRight) |
| 65 { | 65 { |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 RefPtr<AnimatableLength> lengthCalc = create(3, CSSPrimitiveValue::CSS_PX, 5
, CSSPrimitiveValue::CSS_CM); | 359 RefPtr<AnimatableLength> lengthCalc = create(3, CSSPrimitiveValue::CSS_PX, 5
, CSSPrimitiveValue::CSS_CM); |
| 360 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
1, CSSPrimitiveValue::CSS_PX).get())); | 360 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
1, CSSPrimitiveValue::CSS_PX).get())); |
| 361 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
2, CSSPrimitiveValue::CSS_PERCENTAGE).get())); | 361 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
2, CSSPrimitiveValue::CSS_PERCENTAGE).get())); |
| 362 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
3, CSSPrimitiveValue::CSS_EMS).get())); | 362 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
3, CSSPrimitiveValue::CSS_EMS).get())); |
| 363 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
4, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get())); | 363 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
4, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get())); |
| 364 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
0, CSSPrimitiveValue::CSS_PERCENTAGE).get())); | 364 EXPECT_EQ(AnimatableLength::UnitTypeCalc, commonUnitType(lengthCalc, create(
0, CSSPrimitiveValue::CSS_PERCENTAGE).get())); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace WebCore | 367 } // namespace WebCore |
| OLD | NEW |