Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 787763006: cc: Adding BeginFrameTracker object and removing Now() from LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto dependent patches. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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));
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 24 matching lines...) Expand all
432 EXPECT_LE(num_requests_, 2); 432 EXPECT_LE(num_requests_, 2);
433 if (num_requests_ > 1) 433 if (num_requests_ > 1)
434 return; 434 return;
435 ExpectCreateToFail(); 435 ExpectCreateToFail();
436 layer_tree_host()->SetOutputSurface( 436 layer_tree_host()->SetOutputSurface(
437 make_scoped_ptr(new FailureOutputSurface(false))); 437 make_scoped_ptr(new FailureOutputSurface(false)));
438 } 438 }
439 439
440 void BeginTest() override { 440 void BeginTest() override {
441 // First composite tries to create a surface. 441 // First composite tries to create a surface.
442 layer_tree_host()->Composite(base::TimeTicks()); 442 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1));
443 EXPECT_EQ(num_requests_, 2); 443 EXPECT_EQ(num_requests_, 2);
444 EXPECT_TRUE(has_failed_); 444 EXPECT_TRUE(has_failed_);
445 445
446 // Second composite should not request or fail. 446 // Second composite should not request or fail.
447 layer_tree_host()->Composite(base::TimeTicks()); 447 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(2));
448 EXPECT_EQ(num_requests_, 2); 448 EXPECT_EQ(num_requests_, 2);
449 EndTest(); 449 EndTest();
450 } 450 }
451 451
452 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } 452 void DidInitializeOutputSurface() override { EXPECT_TRUE(false); }
453 453
454 void DidFailToInitializeOutputSurface() override { 454 void DidFailToInitializeOutputSurface() override {
455 LayerTreeHostContextTest::DidFailToInitializeOutputSurface(); 455 LayerTreeHostContextTest::DidFailToInitializeOutputSurface();
456 EXPECT_FALSE(has_failed_); 456 EXPECT_FALSE(has_failed_);
457 has_failed_ = true; 457 has_failed_ = true;
(...skipping 24 matching lines...) Expand all
482 CreateAndSetOutputSurface, 482 CreateAndSetOutputSurface,
483 base::Unretained(this))); 483 base::Unretained(this)));
484 } 484 }
485 485
486 void CreateAndSetOutputSurface() { 486 void CreateAndSetOutputSurface() {
487 creating_output_ = true; 487 creating_output_ = true;
488 layer_tree_host()->SetOutputSurface( 488 layer_tree_host()->SetOutputSurface(
489 LayerTreeHostContextTest::CreateOutputSurface()); 489 LayerTreeHostContextTest::CreateOutputSurface());
490 } 490 }
491 491
492 void BeginTest() override { layer_tree_host()->Composite(base::TimeTicks()); } 492 void BeginTest() override {
493 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1));
494 }
493 495
494 void ScheduleComposite() override { 496 void ScheduleComposite() override {
495 if (creating_output_) 497 if (creating_output_)
496 EndTest(); 498 EndTest();
497 } 499 }
498 500
499 void AfterTest() override {} 501 void AfterTest() override {}
500 502
501 bool creating_output_; 503 bool creating_output_;
502 }; 504 };
(...skipping 12 matching lines...) Expand all
515 } 517 }
516 518
517 void RequestNewOutputSurface() override { 519 void RequestNewOutputSurface() override {
518 layer_tree_host()->SetOutputSurface( 520 layer_tree_host()->SetOutputSurface(
519 LayerTreeHostContextTest::CreateOutputSurface()); 521 LayerTreeHostContextTest::CreateOutputSurface());
520 EndTest(); 522 EndTest();
521 } 523 }
522 524
523 void BeginTest() override { 525 void BeginTest() override {
524 in_composite_ = true; 526 in_composite_ = true;
525 layer_tree_host()->Composite(base::TimeTicks()); 527 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1));
526 in_composite_ = false; 528 in_composite_ = false;
527 } 529 }
528 530
529 void ScheduleComposite() override { EXPECT_FALSE(in_composite_); } 531 void ScheduleComposite() override { EXPECT_FALSE(in_composite_); }
530 532
531 void AfterTest() override {} 533 void AfterTest() override {}
532 534
533 bool in_composite_; 535 bool in_composite_;
534 }; 536 };
535 537
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 void AfterTest() override {} 1794 void AfterTest() override {}
1793 1795
1794 bool deferred_; 1796 bool deferred_;
1795 }; 1797 };
1796 1798
1797 SINGLE_AND_MULTI_THREAD_TEST_F( 1799 SINGLE_AND_MULTI_THREAD_TEST_F(
1798 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); 1800 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame);
1799 1801
1800 } // namespace 1802 } // namespace
1801 } // namespace cc 1803 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698