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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 85693007: cc: Defer first OutputSurface creation until client is ready (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_unittest_context.cc
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 44347d3e88493e6e617298c1b1cda2ac18812b4d..c6b6ba396254b511cb335c286cf846f671d06643 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -1286,7 +1286,7 @@ class LayerTreeHostContextTestDontUseLostResources
virtual scoped_ptr<OutputSurface> CreateOutputSurface(
bool fallback) OVERRIDE {
- if (layer_tree_host()) {
+ if (layer_tree_host()->source_frame_number() > 0) {
danakj 2013/11/26 16:35:15 Can you explain this one?
no sievers 2013/11/26 19:28:37 What this function was doing is return an output s
no sievers 2013/11/26 19:30:23 Actually, it's not failing the output surface crea
danakj 2013/11/26 19:44:58 Ah, right ok. Comment would be nice thanks :)
lost_context_ = true;
EXPECT_EQ(layer_tree_host()->source_frame_number(), 3);
}
@@ -1762,43 +1762,6 @@ class LayerTreeHostContextTestFailsToCreateSurface
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostContextTestFailsToCreateSurface);
-// Not reusing LayerTreeTest because it expects creating LTH to always succeed.
-class LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface
- : public testing::Test,
- public FakeLayerTreeHostClient {
- public:
- LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface()
- : FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D) {}
-
- // FakeLayerTreeHostClient implementation.
- virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback)
- OVERRIDE {
- return scoped_ptr<OutputSurface>();
- }
-
- void RunTest(bool threaded,
- bool delegating_renderer,
- bool impl_side_painting) {
- LayerTreeSettings settings;
- settings.impl_side_painting = impl_side_painting;
- if (threaded) {
- scoped_ptr<base::Thread> impl_thread(new base::Thread("LayerTreeTest"));
- ASSERT_TRUE(impl_thread->Start());
- ASSERT_TRUE(impl_thread->message_loop_proxy().get());
- scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::CreateThreaded(
- this, NULL, settings, impl_thread->message_loop_proxy());
- EXPECT_FALSE(layer_tree_host);
- } else {
- scoped_ptr<LayerTreeHost> layer_tree_host =
- LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings);
- EXPECT_FALSE(layer_tree_host);
- }
- }
-};
-
-SINGLE_AND_MULTI_THREAD_TEST_F(
- LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface);
-
class UIResourceLostTest : public LayerTreeHostContextTest {
public:
UIResourceLostTest() : time_step_(0) {}

Powered by Google App Engine
This is Rietveld 408576698