| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 { | 76 { |
| 77 LegacyStyleInterpolation* interpolation = toLegacyStyleInterpolation(interpo
lationValue.get()); | 77 LegacyStyleInterpolation* interpolation = toLegacyStyleInterpolation(interpo
lationValue.get()); |
| 78 RefPtrWillBeRawPtr<AnimatableValue> value = interpolation->currentValue(); | 78 RefPtrWillBeRawPtr<AnimatableValue> value = interpolation->currentValue(); |
| 79 | 79 |
| 80 ASSERT_TRUE(value->isLength() || value->isUnknown()); | 80 ASSERT_TRUE(value->isLength() || value->isUnknown()); |
| 81 | 81 |
| 82 double actualValue; | 82 double actualValue; |
| 83 if (value->isLength()) | 83 if (value->isLength()) |
| 84 actualValue = toAnimatableLength(value.get())->length(1, ValueRangeAll).
value(); | 84 actualValue = toAnimatableLength(value.get())->length(1, ValueRangeAll).
value(); |
| 85 else | 85 else |
| 86 actualValue = toCSSPrimitiveValue(toAnimatableUnknown(value.get())->toCS
SValue().get())->getDoubleValue(); | 86 actualValue = toCSSPrimitiveValue(toAnimatableUnknown(value.get())->toCS
SValue()).getDoubleValue(); |
| 87 | 87 |
| 88 EXPECT_FLOAT_EQ(static_cast<float>(expectedValue), actualValue); | 88 EXPECT_FLOAT_EQ(static_cast<float>(expectedValue), actualValue); |
| 89 } | 89 } |
| 90 | 90 |
| 91 Interpolation* findValue(WillBeHeapVector<RefPtrWillBeMember<Interpolation>>& va
lues, CSSPropertyID id) | 91 Interpolation* findValue(WillBeHeapVector<RefPtrWillBeMember<Interpolation>>& va
lues, CSSPropertyID id) |
| 92 { | 92 { |
| 93 for (auto& value : values) { | 93 for (auto& value : values) { |
| 94 if (toLegacyStyleInterpolation(value.get())->id() == id) | 94 if (toLegacyStyleInterpolation(value.get())->id() == id) |
| 95 return value.get(); | 95 return value.get(); |
| 96 } | 96 } |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 EXPECT_DOUBLE_EQ(0.6, result[5]->offset()); | 566 EXPECT_DOUBLE_EQ(0.6, result[5]->offset()); |
| 567 EXPECT_DOUBLE_EQ(0.7, result[6]->offset()); | 567 EXPECT_DOUBLE_EQ(0.7, result[6]->offset()); |
| 568 EXPECT_DOUBLE_EQ(0.8, result[7]->offset()); | 568 EXPECT_DOUBLE_EQ(0.8, result[7]->offset()); |
| 569 EXPECT_DOUBLE_EQ(0.85, result[8]->offset()); | 569 EXPECT_DOUBLE_EQ(0.85, result[8]->offset()); |
| 570 EXPECT_DOUBLE_EQ(0.9, result[9]->offset()); | 570 EXPECT_DOUBLE_EQ(0.9, result[9]->offset()); |
| 571 EXPECT_DOUBLE_EQ(0.95, result[10]->offset()); | 571 EXPECT_DOUBLE_EQ(0.95, result[10]->offset()); |
| 572 EXPECT_DOUBLE_EQ(1.0, result[11]->offset()); | 572 EXPECT_DOUBLE_EQ(1.0, result[11]->offset()); |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace blink | 575 } // namespace blink |
| OLD | NEW |