1. Token CRCs are not handled correctly. This adds the corrected Whispernet binary...
[chromium-blink-merge.git] / chrome / browser / sync / profile_sync_test_util.h
blob426eb520fb7a69e0bd95ccee5f8d1bb052f365d0
1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "base/message_loop/message_loop.h"
12 #include "base/synchronization/waitable_event.h"
13 #include "chrome/browser/sync/profile_sync_service_observer.h"
14 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/notification_service.h"
16 #include "content/public/browser/notification_source.h"
17 #include "content/public/browser/notification_types.h"
18 #include "testing/gmock/include/gmock/gmock.h"
20 namespace base {
21 class Thread;
24 ACTION_P(Notify, type) {
25 content::NotificationService::current()->Notify(
26 type,
27 content::NotificationService::AllSources(),
28 content::NotificationService::NoDetails());
31 ACTION(QuitUIMessageLoop) {
32 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
33 base::MessageLoop::current()->Quit();
36 class ProfileSyncServiceObserverMock : public ProfileSyncServiceObserver {
37 public:
38 ProfileSyncServiceObserverMock();
39 virtual ~ProfileSyncServiceObserverMock();
41 MOCK_METHOD0(OnStateChanged, void());
44 class ThreadNotifier : // NOLINT
45 public base::RefCountedThreadSafe<ThreadNotifier> {
46 public:
47 explicit ThreadNotifier(base::Thread* notify_thread);
49 void Notify(int type, const content::NotificationDetails& details);
51 void Notify(int type,
52 const content::NotificationSource& source,
53 const content::NotificationDetails& details);
55 private:
56 friend class base::RefCountedThreadSafe<ThreadNotifier>;
57 virtual ~ThreadNotifier();
59 void NotifyTask(int type,
60 const content::NotificationSource& source,
61 const content::NotificationDetails& details);
63 base::WaitableEvent done_event_;
64 base::Thread* notify_thread_;
67 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_