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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 606113003: Revert of Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 75c28428766558d995c7d4735da6dae25519ea5c..007059749676cdffb3affc9a4a426c502d463628 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -63,8 +63,7 @@
times_create_failed_(0),
committed_at_least_once_(false),
context_should_support_io_surface_(false),
- fallback_context_works_(false),
- async_output_surface_creation_(false) {
+ fallback_context_works_(false) {
media::InitializeMediaLibraryForTesting();
}
@@ -154,7 +153,6 @@
bool committed_at_least_once_;
bool context_should_support_io_surface_;
bool fallback_context_works_;
- bool async_output_surface_creation_;
};
class LayerTreeHostContextTestLostContextSucceeds
@@ -170,24 +168,6 @@
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
- virtual void RequestNewOutputSurface(bool fallback) OVERRIDE {
- if (async_output_surface_creation_) {
- MainThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&LayerTreeHostContextTestLostContextSucceeds::
- CreateAndSetOutputSurface,
- base::Unretained(this),
- fallback));
- } else {
- CreateAndSetOutputSurface(fallback);
- }
- }
-
- void CreateAndSetOutputSurface(bool fallback) {
- layer_tree_host()->SetOutputSurface(
- LayerTreeHostContextTest::CreateOutputSurface(fallback));
- }
-
virtual void DidInitializeOutputSurface() OVERRIDE {
if (first_initialized_)
++num_losses_;
@@ -197,7 +177,7 @@
recovered_context_ = true;
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(11u, test_case_); }
+ virtual void AfterTest() OVERRIDE { EXPECT_EQ(7u, test_case_); }
virtual void DidCommitAndDrawFrame() OVERRIDE {
// If the last frame had a context loss, then we'll commit again to
@@ -231,35 +211,24 @@
0, // times_to_lose_during_draw
0, // times_to_fail_recreate
false, // fallback_context_works
- false, // async_output_surface_creation
},
{
0, // times_to_lose_during_commit
1, // times_to_lose_during_draw
0, // times_to_fail_recreate
false, // fallback_context_works
- false, // async_output_surface_creation
},
{
1, // times_to_lose_during_commit
0, // times_to_lose_during_draw
3, // times_to_fail_recreate
false, // fallback_context_works
- false, // async_output_surface_creation
},
{
0, // times_to_lose_during_commit
1, // times_to_lose_during_draw
3, // times_to_fail_recreate
false, // fallback_context_works
- false, // async_output_surface_creation
- },
- {
- 0, // times_to_lose_during_commit
- 1, // times_to_lose_during_draw
- 3, // times_to_fail_recreate
- false, // fallback_context_works
- true, // async_output_surface_creation
},
// Losing the context and recreating it any number of times should
// succeed.
@@ -268,44 +237,20 @@
0, // times_to_lose_during_draw
0, // times_to_fail_recreate
false, // fallback_context_works
- false, // async_output_surface_creation
},
{
0, // times_to_lose_during_commit
10, // times_to_lose_during_draw
0, // times_to_fail_recreate
false, // fallback_context_works
- false, // async_output_surface_creation
- },
- {
- 10, // times_to_lose_during_commit
- 0, // times_to_lose_during_draw
- 0, // times_to_fail_recreate
- false, // fallback_context_works
- true, // async_output_surface_creation
- },
- {
- 0, // times_to_lose_during_commit
- 10, // times_to_lose_during_draw
- 0, // times_to_fail_recreate
- false, // fallback_context_works
- true, // async_output_surface_creation
},
// Losing the context, failing to reinitialize it, and making a fallback
// context should work.
- {
- 0, // times_to_lose_during_commit
- 1, // times_to_lose_during_draw
- 0, // times_to_fail_recreate
- true, // fallback_context_works
- false, // async_output_surface_creation
- },
{
0, // times_to_lose_during_commit
1, // times_to_lose_during_draw
0, // times_to_fail_recreate
true, // fallback_context_works
- true, // async_output_surface_creation
},
};
@@ -321,8 +266,6 @@
times_to_lose_during_draw_ = kTests[test_case_].times_to_lose_during_draw;
times_to_fail_recreate_ = kTests[test_case_].times_to_fail_recreate;
fallback_context_works_ = kTests[test_case_].fallback_context_works;
- async_output_surface_creation_ =
- kTests[test_case_].async_output_surface_creation;
++test_case_;
return true;
}
@@ -332,7 +275,6 @@
int times_to_lose_during_draw;
int times_to_fail_recreate;
bool fallback_context_works;
- bool async_output_surface_creation;
};
protected:
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698