OLD | NEW |
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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 return base::Closure(); | 316 return base::Closure(); |
317 } | 317 } |
318 | 318 |
319 DISALLOW_COPY_AND_ASSIGN(NullLayerDelegate); | 319 DISALLOW_COPY_AND_ASSIGN(NullLayerDelegate); |
320 }; | 320 }; |
321 | 321 |
322 // Remembers if it has been notified. | 322 // Remembers if it has been notified. |
323 class TestCompositorObserver : public CompositorObserver { | 323 class TestCompositorObserver : public CompositorObserver { |
324 public: | 324 public: |
325 TestCompositorObserver() | 325 TestCompositorObserver() |
326 : will_start_(false), started_(false), ended_(false), aborted_(false) {} | 326 : started_(false), ended_(false), aborted_(false) {} |
327 | 327 |
328 bool notified() const { return will_start_ && started_ && ended_; } | 328 bool notified() const { return started_ && ended_; } |
329 bool aborted() const { return aborted_; } | 329 bool aborted() const { return aborted_; } |
330 | 330 |
331 void Reset() { | 331 void Reset() { |
332 will_start_ = false; | |
333 started_ = false; | 332 started_ = false; |
334 ended_ = false; | 333 ended_ = false; |
335 aborted_ = false; | 334 aborted_ = false; |
336 } | 335 } |
337 | 336 |
338 private: | 337 private: |
339 virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE { | 338 virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE { |
340 } | 339 } |
341 | 340 |
342 virtual void OnCompositingWillStart(Compositor* compositor) OVERRIDE { | |
343 will_start_ = true; | |
344 } | |
345 | |
346 virtual void OnCompositingStarted(Compositor* compositor) OVERRIDE { | 341 virtual void OnCompositingStarted(Compositor* compositor) OVERRIDE { |
347 started_ = true; | 342 started_ = true; |
348 } | 343 } |
349 | 344 |
350 virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE { | 345 virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE { |
351 ended_ = true; | 346 ended_ = true; |
352 } | 347 } |
353 | 348 |
354 virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE { | 349 virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE { |
355 aborted_ = true; | 350 aborted_ = true; |
356 } | 351 } |
357 | 352 |
358 bool will_start_; | 353 virtual void OnCompositingLockStateChanged(Compositor* compositor) OVERRIDE { |
| 354 } |
| 355 |
359 bool started_; | 356 bool started_; |
360 bool ended_; | 357 bool ended_; |
361 bool aborted_; | 358 bool aborted_; |
362 | 359 |
363 DISALLOW_COPY_AND_ASSIGN(TestCompositorObserver); | 360 DISALLOW_COPY_AND_ASSIGN(TestCompositorObserver); |
364 }; | 361 }; |
365 | 362 |
366 } // namespace | 363 } // namespace |
367 | 364 |
368 #if defined(OS_WIN) | 365 #if defined(OS_WIN) |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 | 1296 |
1300 // Resize layer. | 1297 // Resize layer. |
1301 child->SetBounds(gfx::Rect(200, 200, 400, 400)); | 1298 child->SetBounds(gfx::Rect(200, 200, 400, 400)); |
1302 child->SetVisible(true); | 1299 child->SetVisible(true); |
1303 EXPECT_TRUE(schedule_draw_invoked_); | 1300 EXPECT_TRUE(schedule_draw_invoked_); |
1304 DrawTree(root.get()); | 1301 DrawTree(root.get()); |
1305 EXPECT_TRUE(delegate.painted()); | 1302 EXPECT_TRUE(delegate.painted()); |
1306 } | 1303 } |
1307 | 1304 |
1308 } // namespace ui | 1305 } // namespace ui |
OLD | NEW |