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

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

Issue 1419283002: cc: Split Proxy and TaskRunnerProvider for the LayerTreeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 1 month 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 root_layer->SetBounds(gfx::Size(1024, 1024)); 368 root_layer->SetBounds(gfx::Size(1024, 1024));
369 root_layer->SetIsDrawable(true); 369 root_layer->SetIsDrawable(true);
370 370
371 layer_tree_host()->SetRootLayer(root_layer); 371 layer_tree_host()->SetRootLayer(root_layer);
372 LayerTreeHostTest::SetupTree(); 372 LayerTreeHostTest::SetupTree();
373 } 373 }
374 374
375 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 375 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
376 if (!toggled_visibility_) { 376 if (!toggled_visibility_) {
377 { 377 {
378 DebugScopedSetMainThread main(proxy()); 378 DebugScopedSetMainThread main(task_runner_provider());
379 layer_tree_host()->SetVisible(false); 379 layer_tree_host()->SetVisible(false);
380 } 380 }
381 toggled_visibility_ = true; 381 toggled_visibility_ = true;
382 EXPECT_FALSE(host_impl->visible()); 382 EXPECT_FALSE(host_impl->visible());
383 } 383 }
384 } 384 }
385 385
386 void NotifyReadyToDrawOnThread(LayerTreeHostImpl* host_impl) override { 386 void NotifyReadyToDrawOnThread(LayerTreeHostImpl* host_impl) override {
387 // Sometimes the worker thread posts NotifyReadyToDraw in the extremely 387 // Sometimes the worker thread posts NotifyReadyToDraw in the extremely
388 // short duration of time between PrepareTiles and SetVisible(false) so we 388 // short duration of time between PrepareTiles and SetVisible(false) so we
389 // might get two NotifyReadyToDraw signals for this test. 389 // might get two NotifyReadyToDraw signals for this test.
390 did_notify_ready_to_draw_ = true; 390 did_notify_ready_to_draw_ = true;
391 } 391 }
392 392
393 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { 393 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
394 EXPECT_FALSE(did_draw_); 394 EXPECT_FALSE(did_draw_);
395 did_draw_ = true; 395 did_draw_ = true;
396 EndTest(); 396 EndTest();
397 } 397 }
398 398
399 void DidFinishImplFrameOnThread(LayerTreeHostImpl* host_impl) override { 399 void DidFinishImplFrameOnThread(LayerTreeHostImpl* host_impl) override {
400 if (!host_impl->visible()) { 400 if (!host_impl->visible()) {
401 { 401 {
402 DebugScopedSetMainThread main(proxy()); 402 DebugScopedSetMainThread main(task_runner_provider());
403 layer_tree_host()->SetVisible(true); 403 layer_tree_host()->SetVisible(true);
404 } 404 }
405 EXPECT_TRUE(host_impl->visible()); 405 EXPECT_TRUE(host_impl->visible());
406 } 406 }
407 } 407 }
408 408
409 void AfterTest() override { 409 void AfterTest() override {
410 EXPECT_TRUE(did_notify_ready_to_draw_); 410 EXPECT_TRUE(did_notify_ready_to_draw_);
411 EXPECT_TRUE(did_draw_); 411 EXPECT_TRUE(did_draw_);
412 } 412 }
(...skipping 5988 matching lines...) Expand 10 before | Expand all | Expand 10 after
6401 EndTest(); 6401 EndTest();
6402 } 6402 }
6403 6403
6404 void AfterTest() override {} 6404 void AfterTest() override {}
6405 }; 6405 };
6406 6406
6407 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6407 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6408 6408
6409 } // namespace 6409 } // namespace
6410 } // namespace cc 6410 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_readback.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698