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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <stack> | 8 #include <stack> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 } | 590 } |
591 | 591 |
592 FakeDriveServiceHelper* fake_drive_service_helper() { | 592 FakeDriveServiceHelper* fake_drive_service_helper() { |
593 return fake_drive_service_helper_.get(); | 593 return fake_drive_service_helper_.get(); |
594 } | 594 } |
595 | 595 |
596 void WaitForIdleWorker() { | 596 void WaitForIdleWorker() { |
597 base::RunLoop run_loop; | 597 base::RunLoop run_loop; |
598 worker_task_runner_->PostTask( | 598 worker_task_runner_->PostTask( |
599 FROM_HERE, | 599 FROM_HERE, |
600 base::Bind(&SyncWorker::CallOnIdleForTesting, | 600 base::BindOnce( |
601 base::Unretained(sync_worker()), | 601 &SyncWorker::CallOnIdleForTesting, base::Unretained(sync_worker()), |
602 RelayCallbackToCurrentThread( | 602 RelayCallbackToCurrentThread(FROM_HERE, run_loop.QuitClosure()))); |
603 FROM_HERE, | |
604 run_loop.QuitClosure()))); | |
605 run_loop.Run(); | 603 run_loop.Run(); |
606 } | 604 } |
607 | 605 |
608 private: | 606 private: |
609 SyncWorker* sync_worker() { | 607 SyncWorker* sync_worker() { |
610 return static_cast<SyncWorker*>(remote_sync_service_->sync_worker_.get()); | 608 return static_cast<SyncWorker*>(remote_sync_service_->sync_worker_.get()); |
611 } | 609 } |
612 | 610 |
613 // MetadataDatabase is normally used on the worker thread. | 611 // MetadataDatabase is normally used on the worker thread. |
614 // Use this only when there is no task running on the worker. | 612 // Use this only when there is no task running on the worker. |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1719 | 1717 |
1720 EXPECT_EQ(1u, CountApp()); | 1718 EXPECT_EQ(1u, CountApp()); |
1721 EXPECT_EQ(1u, CountLocalFile(app_id)); | 1719 EXPECT_EQ(1u, CountLocalFile(app_id)); |
1722 | 1720 |
1723 EXPECT_EQ(2u, CountMetadata()); | 1721 EXPECT_EQ(2u, CountMetadata()); |
1724 EXPECT_EQ(2u, CountTracker()); | 1722 EXPECT_EQ(2u, CountTracker()); |
1725 } | 1723 } |
1726 | 1724 |
1727 } // namespace drive_backend | 1725 } // namespace drive_backend |
1728 } // namespace sync_file_system | 1726 } // namespace sync_file_system |
OLD | NEW |