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

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 try jobs. 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
« no previous file with comments | « chrome/browser/sync/glue/ui_model_worker.cc ('k') | chrome/browser/sync/util/unrecoverable_error_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c904ad3503b2ef880ec8abed2ed4b3e39062efdb 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/util/unrecoverable_error_info.h"
#include "content/browser/browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
using browser_sync::UIModelWorker;
+using browser_sync::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,10 @@ class Syncer {
~Syncer() {}
void SyncShare(UIModelWorkerVisitor* visitor) {
- scoped_ptr<Callback0::Type> c(NewCallback(visitor,
- &UIModelWorkerVisitor::DoWork));
- worker_->DoWorkAndWaitUntilDone(c.get());
+ // We wait until the callback is executed. So it is safe to use Unretained.
+ browser_sync::WorkCallback c = base::Bind(&UIModelWorkerVisitor::DoWork,
+ base::Unretained(visitor));
+ worker_->DoWorkAndWaitUntilDone(c);
}
private:
scoped_refptr<UIModelWorker> worker_;
« no previous file with comments | « chrome/browser/sync/glue/ui_model_worker.cc ('k') | chrome/browser/sync/util/unrecoverable_error_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698