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