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

Unified Diff: cc/layers/surface_layer_unittest.cc

Issue 834043004: cc: Fix race in SurfaceLayer unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/surface_layer_unittest.cc
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
index f6e1eb6c32fb6b70606d87b9032e9106dc12d942..c3eae0b432eff914853a86cc8aa78485ca1c2b57 100644
--- a/cc/layers/surface_layer_unittest.cc
+++ b/cc/layers/surface_layer_unittest.cc
@@ -179,6 +179,7 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
}
void ChangeTree() {
+ base::AutoLock lock(lock_);
danakj 2015/01/06 15:57:40 This still means ChangeTree and SwapBuffersOnThrea
sohanjg 2015/01/08 12:05:41 Yes, i have changed DidCommit to DidCommitAndDrawF
++commit_count_;
switch (commit_count_) {
case 1:
@@ -204,6 +205,7 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
if (satisfied.size() == 1) {
// Eventually the one SurfaceSequence should be satisfied, but only
// after the layer was removed from the tree, and only once.
+ base::AutoLock lock(lock_);
EXPECT_EQ(1u, satisfied[0]);
EXPECT_LE(1, commit_count_);
EXPECT_FALSE(sequence_was_satisfied_);
@@ -229,6 +231,7 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
SurfaceId required_id_;
std::set<SurfaceSequence> required_set_;
+ base::Lock lock_;
};
// TODO(jbauman): Reenable on single thread once http://crbug.com/421923 is
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698