Index: chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc |
diff --git a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc |
index 63e6322550e0dedbf663e3daa57ea6884df451bb..dd8f61318b63225e029d3836aa1e8ed4834670cb 100644 |
--- a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc |
+++ b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "base/bind.h" |
#include "base/callback.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
@@ -9,6 +10,7 @@ |
#include "base/test/test_timeouts.h" |
#include "base/timer.h" |
#include "chrome/browser/sync/glue/browser_thread_model_worker.h" |
+#include "chrome/browser/sync/util/unrecoverable_error_info.h" |
#include "content/browser/browser_thread.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -38,23 +40,25 @@ class BrowserThreadModelWorkerTest : public testing::Test { |
// Schedule DoWork to be executed on the DB thread and have the test fail if |
// DoWork hasn't executed within action_timeout_ms() ms. |
void ScheduleWork() { |
- scoped_ptr<Callback0::Type> c(NewCallback(this, |
- &BrowserThreadModelWorkerTest::DoWork)); |
+ // We wait until the callback is done. So it is safe to use unretained. |
+ WorkCallback c = base::Bind(&BrowserThreadModelWorkerTest::DoWork, |
+ base::Unretained(this)); |
timer()->Start( |
FROM_HERE, |
TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms()), |
this, |
&BrowserThreadModelWorkerTest::Timeout); |
- worker()->DoWorkAndWaitUntilDone(c.get()); |
+ worker()->DoWorkAndWaitUntilDone(c); |
} |
// This is the work that will be scheduled to be done on the DB thread. |
- void DoWork() { |
+ UnrecoverableErrorInfo DoWork() { |
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
timer_.Stop(); // Stop the failure timer so the test succeeds. |
BrowserThread::PostTask( |
BrowserThread::IO, FROM_HERE, new MessageLoop::QuitTask()); |
did_do_work_ = true; |
+ return UnrecoverableErrorInfo(); |
} |
// This will be called by the OneShotTimer and make the test fail unless |