Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1903)

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationTest.cpp

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 { 729 {
730 RefPtrWillBePersistent<Element> element = document->createElement("foo", ASS ERT_NO_EXCEPTION); 730 RefPtrWillBePersistent<Element> element = document->createElement("foo", ASS ERT_NO_EXCEPTION);
731 731
732 Timing timing; 732 Timing timing;
733 KeyframeEffect* keyframeEffect = KeyframeEffect::create(element.get(), nullp tr, timing); 733 KeyframeEffect* keyframeEffect = KeyframeEffect::create(element.get(), nullp tr, timing);
734 Animation* animation = timeline->play(keyframeEffect); 734 Animation* animation = timeline->play(keyframeEffect);
735 simulateFrame(0); 735 simulateFrame(0);
736 timeline->serviceAnimations(TimingUpdateForAnimationFrame); 736 timeline->serviceAnimations(TimingUpdateForAnimationFrame);
737 EXPECT_EQ(1U, element->elementAnimations()->animations().find(animation)->va lue); 737 EXPECT_EQ(1U, element->elementAnimations()->animations().find(animation)->va lue);
738 738
739 Heap::collectAllGarbage(); 739 ThreadHeap::collectAllGarbage();
740 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); 740 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty());
741 } 741 }
742 742
743 TEST_F(AnimationAnimationTest, HasLowerPriority) 743 TEST_F(AnimationAnimationTest, HasLowerPriority)
744 { 744 {
745 Animation* animation1 = timeline->play(0); 745 Animation* animation1 = timeline->play(0);
746 Animation* animation2 = timeline->play(0); 746 Animation* animation2 = timeline->play(0);
747 EXPECT_TRUE(Animation::hasLowerPriority(animation1, animation2)); 747 EXPECT_TRUE(Animation::hasLowerPriority(animation1, animation2));
748 } 748 }
749 749
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 EXPECT_EQ(Animation::Idle, animation->playStateInternal()); 816 EXPECT_EQ(Animation::Idle, animation->playStateInternal());
817 EXPECT_TRUE(std::isnan(animation->currentTime())); 817 EXPECT_TRUE(std::isnan(animation->currentTime()));
818 EXPECT_TRUE(std::isnan(animation->startTime())); 818 EXPECT_TRUE(std::isnan(animation->startTime()));
819 animation->pause(); 819 animation->pause();
820 EXPECT_EQ(Animation::Pending, animation->playStateInternal()); 820 EXPECT_EQ(Animation::Pending, animation->playStateInternal());
821 EXPECT_EQ(0, animation->currentTime()); 821 EXPECT_EQ(0, animation->currentTime());
822 EXPECT_TRUE(std::isnan(animation->startTime())); 822 EXPECT_TRUE(std::isnan(animation->startTime()));
823 } 823 }
824 824
825 } // namespace blink 825 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698