Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / sync / profile_sync_test_util.cc
blob565c5ad8e98f8f29fb2e394ab1bf5212b1591457
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"
7 #include "base/bind.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(
32 FROM_HERE,
33 base::Bind(&ThreadNotifier::NotifyTask, this, type, source, details));
34 done_event_.Wait();
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);
43 done_event_.Signal();