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

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

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 2 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 setos_counter_++; 409 setos_counter_++;
410 layer_tree_host()->SetOutputSurface(surface.Pass()); 410 layer_tree_host()->SetOutputSurface(surface.Pass());
411 } 411 }
412 412
413 void HideAndReleaseOutputSurface() { 413 void HideAndReleaseOutputSurface() {
414 EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread()); 414 EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread());
415 layer_tree_host()->SetVisible(false); 415 layer_tree_host()->SetVisible(false);
416 scoped_ptr<OutputSurface> surface = 416 scoped_ptr<OutputSurface> surface =
417 layer_tree_host()->ReleaseOutputSurface(); 417 layer_tree_host()->ReleaseOutputSurface();
418 CHECK(surface); 418 CHECK(surface);
419 surface->context_provider()->DetachFromThread();
420 MainThreadTaskRunner()->PostTask( 419 MainThreadTaskRunner()->PostTask(
421 FROM_HERE, 420 FROM_HERE,
422 base::Bind(&LayerTreeHostClientTakeAwayOutputSurface::MakeVisible, 421 base::Bind(&LayerTreeHostClientTakeAwayOutputSurface::MakeVisible,
423 base::Unretained(this))); 422 base::Unretained(this)));
424 } 423 }
425 424
426 void DidInitializeOutputSurface() override { 425 void DidInitializeOutputSurface() override {
427 EXPECT_TRUE(layer_tree_host()->visible()); 426 EXPECT_TRUE(layer_tree_host()->visible());
428 if (setos_counter_ == 1) { 427 if (setos_counter_ == 1) {
429 MainThreadTaskRunner()->PostTask( 428 MainThreadTaskRunner()->PostTask(
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 void AfterTest() override {} 1622 void AfterTest() override {}
1624 1623
1625 bool deferred_; 1624 bool deferred_;
1626 }; 1625 };
1627 1626
1628 SINGLE_AND_MULTI_THREAD_TEST_F( 1627 SINGLE_AND_MULTI_THREAD_TEST_F(
1629 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); 1628 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame);
1630 1629
1631 } // namespace 1630 } // namespace
1632 } // namespace cc 1631 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698