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 "chrome/browser/sync/glue/shared_change_processor.h" | 5 #include "chrome/browser/sync/glue/shared_change_processor.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 ACTION_P(GetWeakPtrToSyncableService, syncable_service) { | 30 ACTION_P(GetWeakPtrToSyncableService, syncable_service) { |
31 // Have to do this within an Action to ensure it's not evaluated on the wrong | 31 // Have to do this within an Action to ensure it's not evaluated on the wrong |
32 // thread. | 32 // thread. |
33 return syncable_service->AsWeakPtr(); | 33 return syncable_service->AsWeakPtr(); |
34 } | 34 } |
35 | 35 |
36 class SyncSharedChangeProcessorTest : public testing::Test { | 36 class SyncSharedChangeProcessorTest : public testing::Test { |
37 public: | 37 public: |
38 SyncSharedChangeProcessorTest() | 38 SyncSharedChangeProcessorTest() |
39 : ui_thread_(BrowserThread::UI, &ui_loop_), | 39 : ui_thread_(BrowserThread::UI, &ui_loop_), |
40 db_thread_(BrowserThread::DB), | 40 db_thread_(BrowserThread::DB) {} |
41 db_syncable_service_(NULL) {} | |
42 | 41 |
43 virtual ~SyncSharedChangeProcessorTest() { | 42 virtual ~SyncSharedChangeProcessorTest() { |
44 EXPECT_FALSE(db_syncable_service_.get()); | 43 EXPECT_FALSE(db_syncable_service_.get()); |
45 } | 44 } |
46 | 45 |
47 protected: | 46 protected: |
48 virtual void SetUp() OVERRIDE { | 47 virtual void SetUp() OVERRIDE { |
49 shared_change_processor_ = new SharedChangeProcessor(); | 48 shared_change_processor_ = new SharedChangeProcessor(); |
50 db_thread_.Start(); | 49 db_thread_.Start(); |
51 EXPECT_TRUE(BrowserThread::PostTask( | 50 EXPECT_TRUE(BrowserThread::PostTask( |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 126 |
128 // Simply connect the shared change processor. It should succeed, and | 127 // Simply connect the shared change processor. It should succeed, and |
129 // nothing further should happen. | 128 // nothing further should happen. |
130 TEST_F(SyncSharedChangeProcessorTest, Basic) { | 129 TEST_F(SyncSharedChangeProcessorTest, Basic) { |
131 Connect(); | 130 Connect(); |
132 } | 131 } |
133 | 132 |
134 } // namespace | 133 } // namespace |
135 | 134 |
136 } // namespace browser_sync | 135 } // namespace browser_sync |
OLD | NEW |