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/delegated_frame_provider.h" | 8 #include "cc/layers/delegated_frame_provider.h" |
9 #include "cc/layers/delegated_frame_resource_collection.h" | 9 #include "cc/layers/delegated_frame_resource_collection.h" |
10 #include "cc/layers/heads_up_display_layer.h" | 10 #include "cc/layers/heads_up_display_layer.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
375 } | 375 } |
376 | 376 |
377 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } | 377 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } |
378 | 378 |
379 void AfterTest() override {} | 379 void AfterTest() override {} |
380 }; | 380 }; |
381 | 381 |
382 SINGLE_AND_MULTI_THREAD_TEST_F( | 382 SINGLE_AND_MULTI_THREAD_TEST_F( |
383 LayerTreeHostClientNotReadyDoesNotCreateOutputSurface); | 383 LayerTreeHostClientNotReadyDoesNotCreateOutputSurface); |
384 | 384 |
385 class LayerTreeHostClientTakeAwayOutputSurface | |
386 : public LayerTreeHostContextTest { | |
387 public: | |
388 LayerTreeHostClientTakeAwayOutputSurface() : LayerTreeHostContextTest() { | |
389 setos_counter = 0; | |
390 } | |
391 | |
392 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | |
393 | |
394 void RequestNewOutputSurface() override { CreateAndSetOutputSurface(); } | |
395 | |
396 void CreateAndSetOutputSurface() { | |
397 scoped_ptr<OutputSurface> surface = | |
398 LayerTreeHostContextTest::CreateOutputSurface(); | |
399 CHECK(surface); | |
400 SetOutputSurface(surface.Pass()); | |
401 } | |
402 | |
403 void SetOutputSurface(scoped_ptr<OutputSurface> surface) { | |
no sievers
2015/09/10 00:00:22
Can this just be part of the function above?
sohanjg
2015/09/10 15:07:23
Done.
| |
404 layer_tree_host()->SetOutputSurface(surface.Pass()); | |
405 setos_counter++; | |
406 if (setos_counter > 1) | |
407 EndTest(); | |
no sievers
2015/09/10 00:00:22
Don't end the test yet.
sohanjg
2015/09/10 15:07:23
Done.
| |
408 } | |
409 | |
410 void ReturnOpSurface() { | |
411 scoped_ptr<OutputSurface> surface = layer_tree_host()->GetOutputSurface(); | |
412 } | |
413 | |
414 void DidInitializeOutputSurface() override { ReturnOpSurface(); } | |
sohanjg
2015/08/26 14:38:56
It expects this to be called in ImplThread, if we
no sievers
2015/09/10 00:00:22
What you can do here is:
EXPECT_TRUE(layer_tre
sohanjg
2015/09/10 15:07:23
For Single Threaded test, the call to MakeVisible
| |
415 | |
416 void AfterTest() override {} | |
417 | |
418 int setos_counter; | |
419 }; | |
420 | |
421 MULTI_THREAD_TEST_F(LayerTreeHostClientTakeAwayOutputSurface); | |
no sievers
2015/09/10 00:00:22
SINGLE_AND_MULTI_THREAD_TEST_F
sohanjg
2015/09/10 15:07:23
Done.
| |
422 | |
385 class MultipleCompositeDoesNotCreateOutputSurface | 423 class MultipleCompositeDoesNotCreateOutputSurface |
386 : public LayerTreeHostContextTest { | 424 : public LayerTreeHostContextTest { |
387 public: | 425 public: |
388 MultipleCompositeDoesNotCreateOutputSurface() | 426 MultipleCompositeDoesNotCreateOutputSurface() |
389 : LayerTreeHostContextTest(), request_count_(0) {} | 427 : LayerTreeHostContextTest(), request_count_(0) {} |
390 | 428 |
391 void InitializeSettings(LayerTreeSettings* settings) override { | 429 void InitializeSettings(LayerTreeSettings* settings) override { |
392 settings->single_thread_proxy_scheduler = false; | 430 settings->single_thread_proxy_scheduler = false; |
393 settings->use_zero_copy = true; | 431 settings->use_zero_copy = true; |
394 settings->use_one_copy = false; | 432 settings->use_one_copy = false; |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1622 void AfterTest() override {} | 1660 void AfterTest() override {} |
1623 | 1661 |
1624 bool deferred_; | 1662 bool deferred_; |
1625 }; | 1663 }; |
1626 | 1664 |
1627 SINGLE_AND_MULTI_THREAD_TEST_F( | 1665 SINGLE_AND_MULTI_THREAD_TEST_F( |
1628 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1666 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
1629 | 1667 |
1630 } // namespace | 1668 } // namespace |
1631 } // namespace cc | 1669 } // namespace cc |
OLD | NEW |