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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 475483002: Revert "Make SingleThreadProxy a SchedulerClient" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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_single_thread_client.h ('k') | cc/trees/layer_tree_host_unittest_context.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.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 9492884e21b3ce310e16c8224ebf179de536bd9d..0e72824085ab31f68320274d98d82c9aa2079a93 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -91,8 +91,8 @@ class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest {
}
virtual void AfterTest() OVERRIDE {
- EXPECT_LE(1, num_commits_);
- EXPECT_LE(1, num_draws_);
+ EXPECT_GE(1, num_commits_);
+ EXPECT_GE(1, num_draws_);
}
private:
@@ -694,6 +694,31 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestUndrawnLayersPushContentBoundsLater);
+class LayerTreeHostTestAbortFrameWhenInvisible : public LayerTreeHostTest {
+ public:
+ LayerTreeHostTestAbortFrameWhenInvisible() {}
+
+ virtual void BeginTest() OVERRIDE {
+ // Request a commit (from the main thread), Which will trigger the commit
+ // flow from the impl side.
+ layer_tree_host()->SetNeedsCommit();
+ // Then mark ourselves as not visible before processing any more messages
+ // on the main thread.
+ layer_tree_host()->SetVisible(false);
+ // If we make it without kicking a frame, we pass!
+ EndTestAfterDelay(1);
+ }
+
+ virtual void Layout() OVERRIDE {
+ ASSERT_FALSE(true);
+ EndTest();
+ }
+
+ virtual void AfterTest() OVERRIDE {}
+};
+
+MULTI_THREAD_TEST_F(LayerTreeHostTestAbortFrameWhenInvisible);
+
// This test verifies that properties on the layer tree host are commited
// to the impl side.
class LayerTreeHostTestCommit : public LayerTreeHostTest {
@@ -1893,7 +1918,7 @@ class LayerTreeHostTestDeferCommits : public LayerTreeHostTest {
int num_complete_commits_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeferCommits);
+MULTI_THREAD_TEST_F(LayerTreeHostTestDeferCommits);
class LayerTreeHostWithProxy : public LayerTreeHost {
public:
@@ -1966,7 +1991,6 @@ TEST(LayerTreeHostTest, PartialUpdatesWithGLRenderer) {
LayerTreeSettings settings;
settings.max_partial_texture_updates = 4;
- settings.single_thread_proxy_scheduler = false;
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
@@ -1986,7 +2010,6 @@ TEST(LayerTreeHostTest, PartialUpdatesWithSoftwareRenderer) {
LayerTreeSettings settings;
settings.max_partial_texture_updates = 4;
- settings.single_thread_proxy_scheduler = false;
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
@@ -2006,7 +2029,6 @@ TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndGLContent) {
LayerTreeSettings settings;
settings.max_partial_texture_updates = 4;
- settings.single_thread_proxy_scheduler = false;
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
@@ -2027,7 +2049,6 @@ TEST(LayerTreeHostTest,
LayerTreeSettings settings;
settings.max_partial_texture_updates = 4;
- settings.single_thread_proxy_scheduler = false;
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
@@ -4526,7 +4547,7 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest {
// TODO(miletus): Flaky test: crbug.com/393995
// MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise);
-class LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit
+class LayerTreeHostTestBreakSwapPromiseForAbortedCommit
: public LayerTreeHostTest {
protected:
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
@@ -4562,59 +4583,7 @@ class LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit
TestSwapPromiseResult swap_promise_result_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(
- LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit);
-
-class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit
- : public LayerTreeHostTest {
- protected:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
-
- virtual void DidCommit() OVERRIDE {
- if (TestEnded())
- return;
- layer_tree_host()->SetDeferCommits(true);
- layer_tree_host()->SetNeedsCommit();
- }
-
- virtual void DidDeferCommit() OVERRIDE {
- layer_tree_host()->DidLoseOutputSurface();
- scoped_ptr<SwapPromise> swap_promise(
- new TestSwapPromise(&swap_promise_result_));
- layer_tree_host()->QueueSwapPromise(swap_promise.Pass());
- layer_tree_host()->SetDeferCommits(false);
- }
-
- virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
- bool did_handle) OVERRIDE {
- EndTest();
- // This lets the test finally commit and exit.
- MainThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit::
- FindOutputSurface,
- base::Unretained(this)));
- }
-
- void FindOutputSurface() {
- layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(true);
- }
-
- virtual void AfterTest() OVERRIDE {
- {
- base::AutoLock lock(swap_promise_result_.lock);
- EXPECT_FALSE(swap_promise_result_.did_swap_called);
- EXPECT_TRUE(swap_promise_result_.did_not_swap_called);
- EXPECT_EQ(SwapPromise::COMMIT_FAILS, swap_promise_result_.reason);
- EXPECT_TRUE(swap_promise_result_.dtor_called);
- }
- }
-
- TestSwapPromiseResult swap_promise_result_;
-};
-
-SINGLE_AND_MULTI_THREAD_TEST_F(
- LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit);
+MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromiseForAbortedCommit);
class SimpleSwapPromiseMonitor : public SwapPromiseMonitor {
public:
@@ -4699,7 +4668,7 @@ class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest {
virtual void AfterTest() OVERRIDE {}
};
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
+MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
: public LayerTreeHostTest {
« no previous file with comments | « cc/trees/layer_tree_host_single_thread_client.h ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698