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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 void InitializeSettings(LayerTreeSettings* settings) override { | 386 void InitializeSettings(LayerTreeSettings* settings) override { |
387 settings->single_thread_proxy_scheduler = false; | 387 settings->single_thread_proxy_scheduler = false; |
388 } | 388 } |
389 | 389 |
390 void RequestNewOutputSurface() override { | 390 void RequestNewOutputSurface() override { |
391 EXPECT_GE(1, ++request_count_); | 391 EXPECT_GE(1, ++request_count_); |
392 EndTest(); | 392 EndTest(); |
393 } | 393 } |
394 | 394 |
395 void BeginTest() override { | 395 void BeginTest() override { |
396 layer_tree_host()->Composite(base::TimeTicks()); | 396 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1)); |
397 layer_tree_host()->Composite(base::TimeTicks()); | 397 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(2)); |
brianderson
2014/12/18 02:01:38
Are real timestamps needed to avoid hitting new DC
mithro-old
2014/12/18 17:22:41
Yeah, base::TimeTicks() is the "null equivalent" v
| |
398 } | 398 } |
399 | 399 |
400 scoped_ptr<OutputSurface> CreateOutputSurface() override { | 400 scoped_ptr<OutputSurface> CreateOutputSurface() override { |
401 EXPECT_TRUE(false); | 401 EXPECT_TRUE(false); |
402 return nullptr; | 402 return nullptr; |
403 } | 403 } |
404 | 404 |
405 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } | 405 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } |
406 | 406 |
407 void AfterTest() override {} | 407 void AfterTest() override {} |
(...skipping 15 matching lines...) Expand all Loading... | |
423 | 423 |
424 void RequestNewOutputSurface() override { | 424 void RequestNewOutputSurface() override { |
425 if (request_count_ == 0) { | 425 if (request_count_ == 0) { |
426 ExpectCreateToFail(); | 426 ExpectCreateToFail(); |
427 layer_tree_host()->SetOutputSurface( | 427 layer_tree_host()->SetOutputSurface( |
428 make_scoped_ptr(new FailureOutputSurface(false))); | 428 make_scoped_ptr(new FailureOutputSurface(false))); |
429 } | 429 } |
430 } | 430 } |
431 | 431 |
432 void BeginTest() override { | 432 void BeginTest() override { |
433 layer_tree_host()->Composite(base::TimeTicks()); | 433 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1)); |
434 layer_tree_host()->Composite(base::TimeTicks()); | 434 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(2)); |
435 } | 435 } |
436 | 436 |
437 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } | 437 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } |
438 | 438 |
439 void DidFailToInitializeOutputSurface() override { | 439 void DidFailToInitializeOutputSurface() override { |
440 LayerTreeHostContextTest::DidFailToInitializeOutputSurface(); | 440 LayerTreeHostContextTest::DidFailToInitializeOutputSurface(); |
441 EXPECT_GE(2, ++request_count_); | 441 EXPECT_GE(2, ++request_count_); |
442 EndTest(); | 442 EndTest(); |
443 } | 443 } |
444 | 444 |
(...skipping 21 matching lines...) Expand all Loading... | |
466 CreateAndSetOutputSurface, | 466 CreateAndSetOutputSurface, |
467 base::Unretained(this))); | 467 base::Unretained(this))); |
468 } | 468 } |
469 | 469 |
470 void CreateAndSetOutputSurface() { | 470 void CreateAndSetOutputSurface() { |
471 creating_output_ = true; | 471 creating_output_ = true; |
472 layer_tree_host()->SetOutputSurface( | 472 layer_tree_host()->SetOutputSurface( |
473 LayerTreeHostContextTest::CreateOutputSurface()); | 473 LayerTreeHostContextTest::CreateOutputSurface()); |
474 } | 474 } |
475 | 475 |
476 void BeginTest() override { layer_tree_host()->Composite(base::TimeTicks()); } | 476 void BeginTest() override { |
477 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1)); | |
478 } | |
477 | 479 |
478 void ScheduleComposite() override { | 480 void ScheduleComposite() override { |
479 if (creating_output_) | 481 if (creating_output_) |
480 EndTest(); | 482 EndTest(); |
481 } | 483 } |
482 | 484 |
483 void AfterTest() override {} | 485 void AfterTest() override {} |
484 | 486 |
485 bool creating_output_; | 487 bool creating_output_; |
486 }; | 488 }; |
(...skipping 12 matching lines...) Expand all Loading... | |
499 } | 501 } |
500 | 502 |
501 void RequestNewOutputSurface() override { | 503 void RequestNewOutputSurface() override { |
502 layer_tree_host()->SetOutputSurface( | 504 layer_tree_host()->SetOutputSurface( |
503 LayerTreeHostContextTest::CreateOutputSurface()); | 505 LayerTreeHostContextTest::CreateOutputSurface()); |
504 EndTest(); | 506 EndTest(); |
505 } | 507 } |
506 | 508 |
507 void BeginTest() override { | 509 void BeginTest() override { |
508 in_composite_ = true; | 510 in_composite_ = true; |
509 layer_tree_host()->Composite(base::TimeTicks()); | 511 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1)); |
510 in_composite_ = false; | 512 in_composite_ = false; |
511 } | 513 } |
512 | 514 |
513 void ScheduleComposite() override { EXPECT_FALSE(in_composite_); } | 515 void ScheduleComposite() override { EXPECT_FALSE(in_composite_); } |
514 | 516 |
515 void AfterTest() override {} | 517 void AfterTest() override {} |
516 | 518 |
517 bool in_composite_; | 519 bool in_composite_; |
518 }; | 520 }; |
519 | 521 |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1800 void AfterTest() override {} | 1802 void AfterTest() override {} |
1801 | 1803 |
1802 bool deferred_; | 1804 bool deferred_; |
1803 }; | 1805 }; |
1804 | 1806 |
1805 SINGLE_AND_MULTI_THREAD_TEST_F( | 1807 SINGLE_AND_MULTI_THREAD_TEST_F( |
1806 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1808 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
1807 | 1809 |
1808 } // namespace | 1810 } // namespace |
1809 } // namespace cc | 1811 } // namespace cc |
OLD | NEW |