summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
authorsievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 21:20:54 +0000
committersievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 21:20:54 +0000
commita668cd743ce83c2cf6226fe73e708427f19d7261 (patch)
tree12f68c2675a41b537fd2795deff16012f8fc507a /cc/test
parentc85e1a8a9bb5ae45fe48e03c500156426127bdda (diff)
downloadchromium_src-a668cd743ce83c2cf6226fe73e708427f19d7261.zip
chromium_src-a668cd743ce83c2cf6226fe73e708427f19d7261.tar.gz
chromium_src-a668cd743ce83c2cf6226fe73e708427f19d7261.tar.bz2
cc: Defer first OutputSurface creation until client is ready
Remove the |first_output_surface| which was not used before the client signals ready. This allows the client to wait before creating a graphics context until the gpu thread and client channel are set up. BUG=270179 R=danakj@chromium.org, jamesr@chromium.org, jochen@chromium.org Review URL: https://codereview.chromium.org/85693007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r--cc/test/fake_proxy.h2
-rw-r--r--cc/test/layer_tree_test.cc12
-rw-r--r--cc/test/layer_tree_test.h9
3 files changed, 13 insertions, 10 deletions
diff --git a/cc/test/fake_proxy.h b/cc/test/fake_proxy.h
index bcde11e..295cd9d 100644
--- a/cc/test/fake_proxy.h
+++ b/cc/test/fake_proxy.h
@@ -38,7 +38,7 @@ class FakeProxy : public Proxy {
virtual void MainThreadHasStoppedFlinging() OVERRIDE {}
virtual bool BeginMainFrameRequested() const OVERRIDE;
virtual bool CommitRequested() const OVERRIDE;
- virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE {}
+ virtual void Start() OVERRIDE {}
virtual void Stop() OVERRIDE {}
virtual void ForceSerializeOnSwapBuffers() OVERRIDE {}
virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index b723c56..d854488 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -288,12 +288,10 @@ class LayerTreeHostForTesting : public LayerTreeHost {
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
scoped_ptr<LayerTreeHostForTesting> layer_tree_host(
new LayerTreeHostForTesting(test_hooks, client, settings));
- bool success;
if (impl_task_runner.get())
- success = layer_tree_host->InitializeThreaded(impl_task_runner);
+ layer_tree_host->InitializeThreaded(impl_task_runner);
else
- success = layer_tree_host->InitializeSingleThreaded(client);
- EXPECT_TRUE(success);
+ layer_tree_host->InitializeSingleThreaded(client);
return layer_tree_host.Pass();
}
@@ -458,6 +456,10 @@ void LayerTreeTest::PostSetNextCommitForcesRedrawToMainThread() {
main_thread_weak_ptr_));
}
+void LayerTreeTest::WillBeginTest() {
+ layer_tree_host_->SetLayerTreeHostClientReady();
+}
+
void LayerTreeTest::DoBeginTest() {
client_ = LayerTreeHostClientForTesting::Create(this);
@@ -472,7 +474,7 @@ void LayerTreeTest::DoBeginTest() {
started_ = true;
beginning_ = true;
SetupTree();
- layer_tree_host_->SetLayerTreeHostClientReady();
+ WillBeginTest();
BeginTest();
beginning_ = false;
if (end_when_begin_returns_)
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h
index ac35a65..c32bcd9 100644
--- a/cc/test/layer_tree_test.h
+++ b/cc/test/layer_tree_test.h
@@ -103,10 +103,6 @@ class LayerTreeTest : public testing::Test, public TestHooks {
public:
virtual ~LayerTreeTest();
- virtual void AfterTest() = 0;
- virtual void BeginTest() = 0;
- virtual void SetupTree();
-
virtual void EndTest();
void EndTestAfterDelay(int delay_milliseconds);
@@ -147,6 +143,11 @@ class LayerTreeTest : public testing::Test, public TestHooks {
void DispatchComposite();
void DispatchDidAddAnimation();
+ virtual void AfterTest() = 0;
+ virtual void WillBeginTest();
+ virtual void BeginTest() = 0;
+ virtual void SetupTree();
+
virtual void RunTest(bool threaded,
bool delegating_renderer,
bool impl_side_painting);