1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/sync/profile_sync_test_util.h"
8 #include "base/threading/thread.h"
10 using content::BrowserThread
;
12 SyncServiceObserverMock::SyncServiceObserverMock() {
15 SyncServiceObserverMock::~SyncServiceObserverMock() {
18 ThreadNotifier::ThreadNotifier(base::Thread
* notify_thread
)
19 : done_event_(false, false),
20 notify_thread_(notify_thread
) {}
22 void ThreadNotifier::Notify(int type
,
23 const content::NotificationDetails
& details
) {
24 Notify(type
, content::NotificationService::AllSources(), details
);
27 void ThreadNotifier::Notify(int type
,
28 const content::NotificationSource
& source
,
29 const content::NotificationDetails
& details
) {
30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI
));
31 notify_thread_
->message_loop()->PostTask(
33 base::Bind(&ThreadNotifier::NotifyTask
, this, type
, source
, details
));
37 ThreadNotifier::~ThreadNotifier() {}
39 void ThreadNotifier::NotifyTask(int type
,
40 const content::NotificationSource
& source
,
41 const content::NotificationDetails
& details
) {
42 content::NotificationService::current()->Notify(type
, source
, details
);