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

Side by Side Diff: ui/compositor/layer_animation_sequence_unittest.cc

Issue 11896017: Thread ui opacity animations (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Correctly deal with sequences meant to start together Created 7 years, 11 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/layer_animation_sequence.h" 5 #include "ui/compositor/layer_animation_sequence.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 sequence.set_is_cyclic(true); 161 sequence.set_is_cyclic(true);
162 162
163 delegate.SetOpacityFromAnimation(start_opacity); 163 delegate.SetOpacityFromAnimation(start_opacity);
164 164
165 start_time += delta; 165 start_time += delta;
166 sequence.set_start_time(start_time); 166 sequence.set_start_time(start_time);
167 sequence.Progress(start_time + base::TimeDelta::FromMilliseconds(101000), 167 sequence.Progress(start_time + base::TimeDelta::FromMilliseconds(101000),
168 &delegate); 168 &delegate);
169 EXPECT_FLOAT_EQ(target_opacity, delegate.GetOpacityForAnimation()); 169 EXPECT_FLOAT_EQ(target_opacity, delegate.GetOpacityForAnimation());
170 sequence.Abort(); 170 sequence.Abort(&delegate);
171 171
172 // Should be able to reuse the sequence after aborting. 172 // Should be able to reuse the sequence after aborting.
173 delegate.SetOpacityFromAnimation(start_opacity); 173 delegate.SetOpacityFromAnimation(start_opacity);
174 start_time += base::TimeDelta::FromMilliseconds(101000); 174 start_time += base::TimeDelta::FromMilliseconds(101000);
175 sequence.set_start_time(start_time); 175 sequence.set_start_time(start_time);
176 sequence.Progress(start_time + base::TimeDelta::FromMilliseconds(100000), 176 sequence.Progress(start_time + base::TimeDelta::FromMilliseconds(100000),
177 &delegate); 177 &delegate);
178 EXPECT_FLOAT_EQ(start_opacity, delegate.GetOpacityForAnimation()); 178 EXPECT_FLOAT_EQ(start_opacity, delegate.GetOpacityForAnimation());
179 } 179 }
180 180
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 EXPECT_TRUE(!observer.last_ended_sequence()); 215 EXPECT_TRUE(!observer.last_ended_sequence());
216 sequence.Progress(start_time + delta, &delegate); 216 sequence.Progress(start_time + delta, &delegate);
217 EXPECT_EQ(observer.last_ended_sequence(), &sequence); 217 EXPECT_EQ(observer.last_ended_sequence(), &sequence);
218 sequence.RemoveObserver(&observer); 218 sequence.RemoveObserver(&observer);
219 } 219 }
220 } 220 }
221 221
222 } // namespace 222 } // namespace
223 223
224 } // namespace ui 224 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698