| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sync_driver/shared_change_processor.h" | 5 #include "components/sync_driver/shared_change_processor.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 void SetAttachmentStore() { | 144 void SetAttachmentStore() { |
| 145 EXPECT_TRUE(backend_thread_.task_runner()->PostTask( | 145 EXPECT_TRUE(backend_thread_.task_runner()->PostTask( |
| 146 FROM_HERE, | 146 FROM_HERE, |
| 147 base::Bind(&SyncSharedChangeProcessorTest::SetAttachmentStoreOnDBThread, | 147 base::Bind(&SyncSharedChangeProcessorTest::SetAttachmentStoreOnDBThread, |
| 148 base::Unretained(this)))); | 148 base::Unretained(this)))); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool HasAttachmentService() { | 151 bool HasAttachmentService() { |
| 152 base::WaitableEvent event(false, false); | 152 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 153 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 153 EXPECT_TRUE(backend_thread_.task_runner()->PostTask( | 154 EXPECT_TRUE(backend_thread_.task_runner()->PostTask( |
| 154 FROM_HERE, | 155 FROM_HERE, |
| 155 base::Bind( | 156 base::Bind( |
| 156 &SyncSharedChangeProcessorTest::CheckAttachmentServiceOnDBThread, | 157 &SyncSharedChangeProcessorTest::CheckAttachmentServiceOnDBThread, |
| 157 base::Unretained(this), base::Unretained(&event)))); | 158 base::Unretained(this), base::Unretained(&event)))); |
| 158 event.Wait(); | 159 event.Wait(); |
| 159 return has_attachment_service_; | 160 return has_attachment_service_; |
| 160 } | 161 } |
| 161 | 162 |
| 162 private: | 163 private: |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // creates AttachmentService and passes it back to the syncable service. | 229 // creates AttachmentService and passes it back to the syncable service. |
| 229 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) { | 230 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) { |
| 230 SetAttachmentStore(); | 231 SetAttachmentStore(); |
| 231 Connect(); | 232 Connect(); |
| 232 EXPECT_TRUE(HasAttachmentService()); | 233 EXPECT_TRUE(HasAttachmentService()); |
| 233 } | 234 } |
| 234 | 235 |
| 235 } // namespace | 236 } // namespace |
| 236 | 237 |
| 237 } // namespace sync_driver | 238 } // namespace sync_driver |
| OLD | NEW |