| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
| 13 #include "components/sync_driver/sync_service_observer.h" | 13 #include "components/sync_driver/sync_service_observer.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
| 16 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
| 17 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class Thread; | 21 class Thread; |
| 22 class Time; |
| 23 class TimeDelta; |
| 22 } | 24 } |
| 23 | 25 |
| 26 // An empty syncer::NetworkTimeUpdateCallback. Used in various tests to |
| 27 // instantiate ProfileSyncService. |
| 28 void EmptyNetworkTimeUpdate(const base::Time&, |
| 29 const base::TimeDelta&, |
| 30 const base::TimeDelta&); |
| 31 |
| 24 ACTION_P(Notify, type) { | 32 ACTION_P(Notify, type) { |
| 25 content::NotificationService::current()->Notify( | 33 content::NotificationService::current()->Notify( |
| 26 type, | 34 type, |
| 27 content::NotificationService::AllSources(), | 35 content::NotificationService::AllSources(), |
| 28 content::NotificationService::NoDetails()); | 36 content::NotificationService::NoDetails()); |
| 29 } | 37 } |
| 30 | 38 |
| 31 ACTION(QuitUIMessageLoop) { | 39 ACTION(QuitUIMessageLoop) { |
| 32 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 40 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 33 base::MessageLoop::current()->QuitWhenIdle(); | 41 base::MessageLoop::current()->QuitWhenIdle(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 58 | 66 |
| 59 void NotifyTask(int type, | 67 void NotifyTask(int type, |
| 60 const content::NotificationSource& source, | 68 const content::NotificationSource& source, |
| 61 const content::NotificationDetails& details); | 69 const content::NotificationDetails& details); |
| 62 | 70 |
| 63 base::WaitableEvent done_event_; | 71 base::WaitableEvent done_event_; |
| 64 base::Thread* notify_thread_; | 72 base::Thread* notify_thread_; |
| 65 }; | 73 }; |
| 66 | 74 |
| 67 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ | 75 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ |
| OLD | NEW |