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

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

Issue 8366030: Introduce the plumbing necessary to report Unrecoverable error from model safe workers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 2 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
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..bf1ba6197560cedcd4172527e02510da76d6ca0e 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,24 @@ 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,
akalin 2011/10/26 00:25:05 comment about unretained
lipalani1 2011/10/26 01:39:11 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698