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

Unified Diff: base/prefs/public/pref_member_unittest.cc

Issue 11624023: Fix flakyness in PrefMemberTest::MoveToThread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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: base/prefs/public/pref_member_unittest.cc
diff --git a/base/prefs/public/pref_member_unittest.cc b/base/prefs/public/pref_member_unittest.cc
index 4203db3aa3caabe01bb771d9897cf976f472378c..eab5a4cc986032c55012c54ff62a2e19fd49c80a 100644
--- a/base/prefs/public/pref_member_unittest.cc
+++ b/base/prefs/public/pref_member_unittest.cc
@@ -56,6 +56,12 @@ class GetPrefValueHelper
event.Wait();
}
+ // The thread must be stopped on the main thread. GetPrefValueHelper being
+ // ref-counted, the destructor can be called from any thread.
+ void StopThread() {
+ pref_thread_.Stop();
+ }
+
bool value() { return value_; }
private:
@@ -313,4 +319,6 @@ TEST(PrefMemberTest, MoveToThread) {
helper->FetchValue();
EXPECT_TRUE(helper->value());
+
+ helper->StopThread();
}
« 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