| 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.
|
|
|