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

Unified Diff: cc/layer_tree_host_unittest.cc

Issue 10690168: Aura: Resize locks with --ui-enable-threaded-compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OSX compile fix. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_unittest.cc
diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc
index 72b094a36cba6363acd0f3f47eb4af092b24b05c..f85111ecdd146373670df900638efa2ebf96547d 100644
--- a/cc/layer_tree_host_unittest.cc
+++ b/cc/layer_tree_host_unittest.cc
@@ -3183,4 +3183,57 @@ TEST_F(LayerTreeHostTestContinuousAnimate, runMultiThread)
runTest(true);
}
+class LayerTreeHostTestDeferCommits : public LayerTreeHostTest {
+public:
+ LayerTreeHostTestDeferCommits()
+ : m_numCommitsDeferred(0)
+ , m_numCompleteCommits(0)
+ {
+ }
+
+ virtual void beginTest() OVERRIDE
+ {
+ postSetNeedsCommitToMainThread();
+ }
+
+ virtual void didDeferCommit() OVERRIDE
+ {
+ m_numCommitsDeferred++;
+ m_layerTreeHost->setDeferCommits(false);
+ }
+
+ virtual void didCommit() OVERRIDE
+ {
+ m_numCompleteCommits++;
+ switch (m_numCompleteCommits) {
+ case 1:
+ EXPECT_EQ(0, m_numCommitsDeferred);
+ m_layerTreeHost->setDeferCommits(true);
+ postSetNeedsCommitToMainThread();
+ break;
+ case 2:
+ endTest();
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+ }
+
+ virtual void afterTest() OVERRIDE
+ {
+ EXPECT_EQ(1, m_numCommitsDeferred);
+ EXPECT_EQ(2, m_numCompleteCommits);
+ }
+
+private:
+ int m_numCommitsDeferred;
+ int m_numCompleteCommits;
+};
+
+TEST_F(LayerTreeHostTestDeferCommits, runMultiThread)
+{
+ runTest(true);
+}
+
} // namespace
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698