Chromium Code Reviews| 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..80b607fc3843243f4146b49efc3540f76c3b7025 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/sessions/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)); |
| + WorkCallback c = base::Bind(&BrowserThreadModelWorkerTest::DoWork, |
| + // We wait until the callback is done. So it is safe to use unretained. |
|
akalin
2011/10/26 01:44:45
You can just put the comment above the expression,
|
| + 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() { |
| + sessions::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 sessions::UnrecoverableErrorInfo(); |
| } |
| // This will be called by the OneShotTimer and make the test fail unless |