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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 timing.timingFunction = defaultTimingFunction; | 557 timing.timingFunction = defaultTimingFunction; |
558 | 558 |
559 applyTimingInputString(timing, isolate, "easing", "initial"); | 559 applyTimingInputString(timing, isolate, "easing", "initial"); |
560 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); | 560 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); |
561 timing.timingFunction = defaultTimingFunction; | 561 timing.timingFunction = defaultTimingFunction; |
562 | 562 |
563 applyTimingInputString(timing, isolate, "easing", "step-start"); | 563 applyTimingInputString(timing, isolate, "easing", "step-start"); |
564 EXPECT_EQ(*(StepsTimingFunction::preset(StepsTimingFunction::Start)), *timin
g.timingFunction.get()); | 564 EXPECT_EQ(*(StepsTimingFunction::preset(StepsTimingFunction::Start)), *timin
g.timingFunction.get()); |
565 timing.timingFunction = defaultTimingFunction; | 565 timing.timingFunction = defaultTimingFunction; |
566 | 566 |
| 567 applyTimingInputString(timing, isolate, "easing", "step-middle"); |
| 568 EXPECT_EQ(*(StepsTimingFunction::preset(StepsTimingFunction::Middle)), *timi
ng.timingFunction.get()); |
| 569 timing.timingFunction = defaultTimingFunction; |
| 570 |
567 applyTimingInputString(timing, isolate, "easing", "step-end"); | 571 applyTimingInputString(timing, isolate, "easing", "step-end"); |
568 EXPECT_EQ(*(StepsTimingFunction::preset(StepsTimingFunction::End)), *timing.
timingFunction.get()); | 572 EXPECT_EQ(*(StepsTimingFunction::preset(StepsTimingFunction::End)), *timing.
timingFunction.get()); |
569 timing.timingFunction = defaultTimingFunction; | 573 timing.timingFunction = defaultTimingFunction; |
570 | 574 |
571 applyTimingInputString(timing, isolate, "easing", "cubic-bezier(1, 1, 0.3, 0
.3)"); | 575 applyTimingInputString(timing, isolate, "easing", "cubic-bezier(1, 1, 0.3, 0
.3)"); |
572 EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), *timin
g.timingFunction.get()); | 576 EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), *timin
g.timingFunction.get()); |
573 timing.timingFunction = defaultTimingFunction; | 577 timing.timingFunction = defaultTimingFunction; |
574 | 578 |
575 applyTimingInputString(timing, isolate, "easing", "steps(3, start)"); | 579 applyTimingInputString(timing, isolate, "easing", "steps(3, start)"); |
576 EXPECT_EQ(*(StepsTimingFunction::create(3, true).get()), *timing.timingFunct
ion.get()); | 580 EXPECT_EQ(*(StepsTimingFunction::create(3, StepsTimingFunction::StepAtStart)
.get()), *timing.timingFunction.get()); |
| 581 timing.timingFunction = defaultTimingFunction; |
| 582 |
| 583 applyTimingInputString(timing, isolate, "easing", "steps(5, middle)"); |
| 584 EXPECT_EQ(*(StepsTimingFunction::create(5, StepsTimingFunction::StepAtMiddle
).get()), *timing.timingFunction.get()); |
577 timing.timingFunction = defaultTimingFunction; | 585 timing.timingFunction = defaultTimingFunction; |
578 | 586 |
579 applyTimingInputString(timing, isolate, "easing", "steps(5, end)"); | 587 applyTimingInputString(timing, isolate, "easing", "steps(5, end)"); |
580 EXPECT_EQ(*(StepsTimingFunction::create(5, false).get()), *timing.timingFunc
tion.get()); | 588 EXPECT_EQ(*(StepsTimingFunction::create(5, StepsTimingFunction::StepAtEnd).g
et()), *timing.timingFunction.get()); |
581 timing.timingFunction = defaultTimingFunction; | 589 timing.timingFunction = defaultTimingFunction; |
582 | 590 |
583 applyTimingInputString(timing, isolate, "easing", "steps(5.6, end)"); | 591 applyTimingInputString(timing, isolate, "easing", "steps(5.6, end)"); |
584 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); | 592 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); |
585 timing.timingFunction = defaultTimingFunction; | 593 timing.timingFunction = defaultTimingFunction; |
586 | 594 |
587 // FIXME: Step-middle not yet implemented. Change this test when it is worki
ng. | |
588 applyTimingInputString(timing, isolate, "easing", "steps(5, middle)"); | |
589 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); | |
590 timing.timingFunction = defaultTimingFunction; | |
591 | |
592 applyTimingInputString(timing, isolate, "easing", "cubic-bezier(2, 2, 0.3, 0
.3)"); | 595 applyTimingInputString(timing, isolate, "easing", "cubic-bezier(2, 2, 0.3, 0
.3)"); |
593 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); | 596 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); |
594 timing.timingFunction = defaultTimingFunction; | 597 timing.timingFunction = defaultTimingFunction; |
595 | 598 |
596 applyTimingInputString(timing, isolate, "easing", "rubbish"); | 599 applyTimingInputString(timing, isolate, "easing", "rubbish"); |
597 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); | 600 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); |
598 timing.timingFunction = defaultTimingFunction; | 601 timing.timingFunction = defaultTimingFunction; |
599 | 602 |
600 applyTimingInputNumber(timing, isolate, "easing", 2); | 603 applyTimingInputNumber(timing, isolate, "easing", 2); |
601 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); | 604 EXPECT_EQ(*defaultTimingFunction.get(), *timing.timingFunction.get()); |
(...skipping 19 matching lines...) Expand all Loading... |
621 EXPECT_EQ(controlTiming.iterationStart, updatedTiming.iterationStart); | 624 EXPECT_EQ(controlTiming.iterationStart, updatedTiming.iterationStart); |
622 EXPECT_EQ(controlTiming.iterationCount, updatedTiming.iterationCount); | 625 EXPECT_EQ(controlTiming.iterationCount, updatedTiming.iterationCount); |
623 EXPECT_EQ(controlTiming.iterationDuration, updatedTiming.iterationDuration); | 626 EXPECT_EQ(controlTiming.iterationDuration, updatedTiming.iterationDuration); |
624 EXPECT_EQ(controlTiming.hasIterationDuration, updatedTiming.hasIterationDura
tion); | 627 EXPECT_EQ(controlTiming.hasIterationDuration, updatedTiming.hasIterationDura
tion); |
625 EXPECT_EQ(controlTiming.playbackRate, updatedTiming.playbackRate); | 628 EXPECT_EQ(controlTiming.playbackRate, updatedTiming.playbackRate); |
626 EXPECT_EQ(controlTiming.direction, updatedTiming.direction); | 629 EXPECT_EQ(controlTiming.direction, updatedTiming.direction); |
627 EXPECT_EQ(*controlTiming.timingFunction.get(), *updatedTiming.timingFunction
.get()); | 630 EXPECT_EQ(*controlTiming.timingFunction.get(), *updatedTiming.timingFunction
.get()); |
628 } | 631 } |
629 | 632 |
630 } // namespace WebCore | 633 } // namespace WebCore |
OLD | NEW |