| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 EXPECT_EQ(FloatSize(110, 90), animator->implOnlyAnimationAdjustmentForTestin
g()); | 579 EXPECT_EQ(FloatSize(110, 90), animator->implOnlyAnimationAdjustmentForTestin
g()); |
| 580 | 580 |
| 581 animator->updateCompositorAnimations(); | 581 animator->updateCompositorAnimations(); |
| 582 | 582 |
| 583 EXPECT_EQ(animator->m_runState, ScrollAnimatorCompositorCoordinator::RunStat
e::Idle); | 583 EXPECT_EQ(animator->m_runState, ScrollAnimatorCompositorCoordinator::RunStat
e::Idle); |
| 584 EXPECT_FALSE(animator->hasAnimationThatRequiresService()); | 584 EXPECT_FALSE(animator->hasAnimationThatRequiresService()); |
| 585 EXPECT_TRUE(animator->implOnlyAnimationAdjustmentForTesting().isZero()); | 585 EXPECT_TRUE(animator->implOnlyAnimationAdjustmentForTesting().isZero()); |
| 586 | 586 |
| 587 // Verify that the takeover update is cleared. | 587 // Verify that the takeover update is cleared. |
| 588 animator->takeOverImplOnlyScrollOffsetAnimation(); | 588 animator->takeOverImplOnlyScrollOffsetAnimation(); |
| 589 EXPECT_TRUE(animator->hasAnimationThatRequiresService()); | |
| 590 animator->updateCompositorAnimations(); | |
| 591 EXPECT_FALSE(animator->hasAnimationThatRequiresService()); | 589 EXPECT_FALSE(animator->hasAnimationThatRequiresService()); |
| 592 | 590 |
| 593 // Forced GC in order to finalize objects depending on the mock object. | 591 // Forced GC in order to finalize objects depending on the mock object. |
| 594 ThreadHeap::collectAllGarbage(); | 592 ThreadHeap::collectAllGarbage(); |
| 595 } | 593 } |
| 596 | 594 |
| 597 TEST(ScrollAnimatorTest, MainThreadAnimationTargetAdjustment) | 595 TEST(ScrollAnimatorTest, MainThreadAnimationTargetAdjustment) |
| 598 { | 596 { |
| 599 MockScrollableArea* scrollableArea = MockScrollableArea::create(true); | 597 MockScrollableArea* scrollableArea = MockScrollableArea::create(true); |
| 600 ScrollAnimator* animator = new ScrollAnimator(scrollableArea, getMockedTime)
; | 598 ScrollAnimator* animator = new ScrollAnimator(scrollableArea, getMockedTime)
; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 animator->updateCompositorAnimations(); | 637 animator->updateCompositorAnimations(); |
| 640 animator->tickAnimation(getMockedTime()); | 638 animator->tickAnimation(getMockedTime()); |
| 641 EXPECT_EQ(FloatPoint(110, 90), animator->currentPosition()); | 639 EXPECT_EQ(FloatPoint(110, 90), animator->currentPosition()); |
| 642 reset(*animator); | 640 reset(*animator); |
| 643 | 641 |
| 644 // Forced GC in order to finalize objects depending on the mock object. | 642 // Forced GC in order to finalize objects depending on the mock object. |
| 645 ThreadHeap::collectAllGarbage(); | 643 ThreadHeap::collectAllGarbage(); |
| 646 } | 644 } |
| 647 | 645 |
| 648 } // namespace blink | 646 } // namespace blink |
| OLD | NEW |