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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "chrome/browser/sync/glue/ui_model_worker.h" | 13 #include "chrome/browser/sync/glue/ui_model_worker.h" |
14 #include "content/test/test_browser_thread.h" | 14 #include "content/public/test/test_browser_thread.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 using browser_sync::UIModelWorker; | 17 using browser_sync::UIModelWorker; |
18 using browser_sync::SyncerError; | 18 using browser_sync::SyncerError; |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
20 | 20 |
21 // Various boilerplate, primarily for the StopWithPendingWork test. | 21 // Various boilerplate, primarily for the StopWithPendingWork test. |
22 | 22 |
23 class UIModelWorkerVisitor { | 23 class UIModelWorkerVisitor { |
24 public: | 24 public: |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 // This is what gets the UI thread blocked until NotifyExitRequested, | 204 // This is what gets the UI thread blocked until NotifyExitRequested, |
205 // which is called when FakeSyncapiShutdownCallback runs and deletes the | 205 // which is called when FakeSyncapiShutdownCallback runs and deletes the |
206 // syncer. | 206 // syncer. |
207 bmw()->Stop(); | 207 bmw()->Stop(); |
208 | 208 |
209 // Was the thread killed? | 209 // Was the thread killed? |
210 EXPECT_FALSE(syncer_thread()->IsRunning()); | 210 EXPECT_FALSE(syncer_thread()->IsRunning()); |
211 core_thread()->Stop(); | 211 core_thread()->Stop(); |
212 } | 212 } |
OLD | NEW |