| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
| 9 #include "cc/layers/delegated_frame_provider.h" | 9 #include "cc/layers/delegated_frame_provider.h" |
| 10 #include "cc/layers/delegated_frame_resource_collection.h" | 10 #include "cc/layers/delegated_frame_resource_collection.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 return nullptr; | 395 return nullptr; |
| 396 } | 396 } |
| 397 | 397 |
| 398 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } | 398 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } |
| 399 | 399 |
| 400 void AfterTest() override {} | 400 void AfterTest() override {} |
| 401 | 401 |
| 402 int request_count_; | 402 int request_count_; |
| 403 }; | 403 }; |
| 404 | 404 |
| 405 SINGLE_THREAD_TEST_F(MultipleCompositeDoesNotCreateOutputSurface); | 405 SINGLE_THREAD_NOIMPL_TEST_F(MultipleCompositeDoesNotCreateOutputSurface); |
| 406 | 406 |
| 407 class FailedCreateDoesNotCreateExtraOutputSurface | 407 class FailedCreateDoesNotCreateExtraOutputSurface |
| 408 : public LayerTreeHostContextTest { | 408 : public LayerTreeHostContextTest { |
| 409 public: | 409 public: |
| 410 FailedCreateDoesNotCreateExtraOutputSurface() | 410 FailedCreateDoesNotCreateExtraOutputSurface() |
| 411 : LayerTreeHostContextTest(), request_count_(0) {} | 411 : LayerTreeHostContextTest(), request_count_(0) {} |
| 412 | 412 |
| 413 void InitializeSettings(LayerTreeSettings* settings) override { | 413 void InitializeSettings(LayerTreeSettings* settings) override { |
| 414 settings->single_thread_proxy_scheduler = false; | 414 settings->single_thread_proxy_scheduler = false; |
| 415 } | 415 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 433 return nullptr; | 433 return nullptr; |
| 434 } | 434 } |
| 435 | 435 |
| 436 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } | 436 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } |
| 437 | 437 |
| 438 void AfterTest() override {} | 438 void AfterTest() override {} |
| 439 | 439 |
| 440 int request_count_; | 440 int request_count_; |
| 441 }; | 441 }; |
| 442 | 442 |
| 443 SINGLE_THREAD_TEST_F(FailedCreateDoesNotCreateExtraOutputSurface); | 443 SINGLE_THREAD_NOIMPL_TEST_F(FailedCreateDoesNotCreateExtraOutputSurface); |
| 444 |
| 445 class LayerTreeHostContextTestCommitAfterDelayedOutputSurface |
| 446 : public LayerTreeHostContextTest { |
| 447 public: |
| 448 LayerTreeHostContextTestCommitAfterDelayedOutputSurface() |
| 449 : LayerTreeHostContextTest(), creating_output_(false) {} |
| 450 |
| 451 void InitializeSettings(LayerTreeSettings* settings) override { |
| 452 settings->single_thread_proxy_scheduler = false; |
| 453 } |
| 454 |
| 455 void RequestNewOutputSurface(bool fallback) override { |
| 456 MainThreadTaskRunner()->PostTask( |
| 457 FROM_HERE, |
| 458 base::Bind(&LayerTreeHostContextTestCommitAfterDelayedOutputSurface:: |
| 459 CreateAndSetOutputSurface, |
| 460 base::Unretained(this), |
| 461 fallback)); |
| 462 } |
| 463 |
| 464 void CreateAndSetOutputSurface(bool fallback) { |
| 465 creating_output_ = true; |
| 466 layer_tree_host()->SetOutputSurface( |
| 467 LayerTreeHostContextTest::CreateOutputSurface(fallback)); |
| 468 } |
| 469 |
| 470 void BeginTest() override { layer_tree_host()->Composite(base::TimeTicks()); } |
| 471 |
| 472 void ScheduleComposite() override { |
| 473 if (creating_output_) |
| 474 EndTest(); |
| 475 } |
| 476 |
| 477 void AfterTest() override {} |
| 478 |
| 479 bool creating_output_; |
| 480 }; |
| 481 |
| 482 SINGLE_THREAD_NOIMPL_TEST_F( |
| 483 LayerTreeHostContextTestCommitAfterDelayedOutputSurface); |
| 484 |
| 485 class LayerTreeHostContextTestAvoidUnnecessaryComposite |
| 486 : public LayerTreeHostContextTest { |
| 487 public: |
| 488 LayerTreeHostContextTestAvoidUnnecessaryComposite() |
| 489 : LayerTreeHostContextTest(), in_composite_(false) {} |
| 490 |
| 491 void InitializeSettings(LayerTreeSettings* settings) override { |
| 492 settings->single_thread_proxy_scheduler = false; |
| 493 } |
| 494 |
| 495 void RequestNewOutputSurface(bool fallback) override { |
| 496 layer_tree_host()->SetOutputSurface( |
| 497 LayerTreeHostContextTest::CreateOutputSurface(fallback)); |
| 498 EndTest(); |
| 499 } |
| 500 |
| 501 void BeginTest() override { |
| 502 in_composite_ = true; |
| 503 layer_tree_host()->Composite(base::TimeTicks()); |
| 504 in_composite_ = false; |
| 505 } |
| 506 |
| 507 void ScheduleComposite() override { EXPECT_FALSE(in_composite_); } |
| 508 |
| 509 void AfterTest() override {} |
| 510 |
| 511 bool in_composite_; |
| 512 }; |
| 513 |
| 514 SINGLE_THREAD_NOIMPL_TEST_F(LayerTreeHostContextTestAvoidUnnecessaryComposite); |
| 444 | 515 |
| 445 class LayerTreeHostContextTestLostContextSucceedsWithContent | 516 class LayerTreeHostContextTestLostContextSucceedsWithContent |
| 446 : public LayerTreeHostContextTestLostContextSucceeds { | 517 : public LayerTreeHostContextTestLostContextSucceeds { |
| 447 public: | 518 public: |
| 448 void SetupTree() override { | 519 void SetupTree() override { |
| 449 root_ = Layer::Create(); | 520 root_ = Layer::Create(); |
| 450 root_->SetBounds(gfx::Size(10, 10)); | 521 root_->SetBounds(gfx::Size(10, 10)); |
| 451 root_->SetIsDrawable(true); | 522 root_->SetIsDrawable(true); |
| 452 | 523 |
| 453 // Paint non-solid color. | 524 // Paint non-solid color. |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 void AfterTest() override {} | 1777 void AfterTest() override {} |
| 1707 | 1778 |
| 1708 bool deferred_; | 1779 bool deferred_; |
| 1709 }; | 1780 }; |
| 1710 | 1781 |
| 1711 SINGLE_AND_MULTI_THREAD_TEST_F( | 1782 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1712 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1783 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
| 1713 | 1784 |
| 1714 } // namespace | 1785 } // namespace |
| 1715 } // namespace cc | 1786 } // namespace cc |
| OLD | NEW |