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

Unified Diff: chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc

Issue 6880051: [Sync] Re-re-reland 81454. This time with fixed waitable event usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix intialization, reduce timeouts Created 9 years, 8 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: chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc
index 8fc2576c3812cd8e69fc0a00eef1a7b261f678f4..eeda4c464f46b876b4ffaef20704abf40779a5d5 100644
--- a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc
@@ -116,8 +116,7 @@ class NonFrontendDataTypeControllerTest : public testing::Test {
: ui_thread_(BrowserThread::UI, &message_loop_),
db_thread_(BrowserThread::DB),
model_associator_(NULL),
- change_processor_(NULL),
- signaled_(false) {}
+ change_processor_(NULL) {}
virtual void SetUp() {
EXPECT_CALL(profile_, GetProfileSyncService()).WillRepeatedly(
@@ -176,23 +175,20 @@ class NonFrontendDataTypeControllerTest : public testing::Test {
EXPECT_CALL(start_callback_, Run(result,_));
}
- static void SignalDone(WaitableEvent* done, bool* signaled) {
+ static void SignalDone(WaitableEvent* done) {
done->Signal();
- *signaled = true;
}
void WaitForDTC() {
- WaitableEvent done(false, false);
- signaled_ = false;
+ WaitableEvent done(true, false);
BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
NewRunnableFunction(&NonFrontendDataTypeControllerTest::SignalDone,
- &done, &signaled_));
+ &done));
done.TimedWait(base::TimeDelta::FromMilliseconds(
TestTimeouts::action_timeout_ms()));
- if (!signaled_) {
+ if (!done.IsSignaled()) {
ADD_FAILURE() << "Timed out waiting for DB thread to finish.";
}
- signaled_ = false;
MessageLoop::current()->RunAllPending();
}
@@ -207,7 +203,6 @@ class NonFrontendDataTypeControllerTest : public testing::Test {
ModelAssociatorMock* model_associator_;
ChangeProcessorMock* change_processor_;
StartCallback start_callback_;
- bool signaled_;
};
TEST_F(NonFrontendDataTypeControllerTest, StartOk) {
« 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