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

Unified Diff: chrome/browser/sync/glue/ui_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/ui_model_worker_unittest.cc
diff --git a/chrome/browser/sync/glue/ui_model_worker_unittest.cc b/chrome/browser/sync/glue/ui_model_worker_unittest.cc
index c0230f1879016f99aa85118b1dde05705c3f0701..9f6f201ae7a61815a03cdbfd3d94265c35f21bdd 100644
--- a/chrome/browser/sync/glue/ui_model_worker_unittest.cc
+++ b/chrome/browser/sync/glue/ui_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/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -9,10 +10,12 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "chrome/browser/sync/glue/ui_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"
using browser_sync::UIModelWorker;
+using browser_sync::sessions::UnrecoverableErrorInfo;
// Various boilerplate, primarily for the StopWithPendingWork test.
@@ -24,11 +27,12 @@ class UIModelWorkerVisitor {
was_run_(was_run) { }
virtual ~UIModelWorkerVisitor() { }
- virtual void DoWork() {
+ virtual UnrecoverableErrorInfo DoWork() {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI));
was_run_->Signal();
if (quit_loop_when_run_)
MessageLoop::current()->Quit();
+ return UnrecoverableErrorInfo();
}
private:
@@ -44,9 +48,9 @@ class Syncer {
~Syncer() {}
void SyncShare(UIModelWorkerVisitor* visitor) {
- scoped_ptr<Callback0::Type> c(NewCallback(visitor,
- &UIModelWorkerVisitor::DoWork));
- worker_->DoWorkAndWaitUntilDone(c.get());
+ browser_sync::WorkCallback c = base::Bind(&UIModelWorkerVisitor::DoWork,
akalin 2011/10/26 00:25:05 comment about unretained
lipalani1 2011/10/26 01:39:11 Done.
+ base::Unretained(visitor));
+ worker_->DoWorkAndWaitUntilDone(c);
}
private:
scoped_refptr<UIModelWorker> worker_;

Powered by Google App Engine
This is Rietveld 408576698