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

Unified Diff: ui/compositor/layer_unittest.cc

Issue 10444014: ash: Improved window maximize/restore animations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix lock screen, app windows Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/layer_animation_observer.h ('k') | ui/gfx/transform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_unittest.cc
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index b46d0a1f06add7ee2b06a56d525ae8a9aef47a8e..df467abd05e18b0ed6a8b7b2a2661f3637063a4c 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -309,13 +309,15 @@ class NullLayerDelegate : public LayerDelegate {
// Remembers if it has been notified.
class TestCompositorObserver : public CompositorObserver {
public:
- TestCompositorObserver() : started_(false), ended_(false) {}
+ TestCompositorObserver() : started_(false), ended_(false), aborted_(false) {}
bool notified() const { return started_ && ended_; }
+ bool aborted() const { return aborted_; }
void Reset() {
started_ = false;
ended_ = false;
+ aborted_ = false;
}
private:
@@ -327,8 +329,13 @@ class TestCompositorObserver : public CompositorObserver {
ended_ = true;
}
+ virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE {
+ aborted_ = true;
+ }
+
bool started_;
bool ended_;
+ bool aborted_;
DISALLOW_COPY_AND_ASSIGN(TestCompositorObserver);
};
@@ -886,6 +893,15 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_CompositorObservers) {
RunPendingMessages();
EXPECT_TRUE(observer.notified());
+ // A change resulting in an aborted swap buffer should alert the observer
+ // and also signal an abort.
+ observer.Reset();
+ l2->SetOpacity(0.1f);
+ GetCompositor()->OnSwapBuffersAborted();
+ RunPendingMessages();
+ EXPECT_TRUE(observer.notified());
+ EXPECT_TRUE(observer.aborted());
+
GetCompositor()->RemoveObserver(&observer);
// Opacity changes should no longer alert the removed observer.
« no previous file with comments | « ui/compositor/layer_animation_observer.h ('k') | ui/gfx/transform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698