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 <algorithm> | 5 #include <algorithm> |
6 #include <stack> | 6 #include <stack> |
7 | 7 |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 } | 576 } |
577 | 577 |
578 FakeDriveServiceHelper* fake_drive_service_helper() { | 578 FakeDriveServiceHelper* fake_drive_service_helper() { |
579 return fake_drive_service_helper_.get(); | 579 return fake_drive_service_helper_.get(); |
580 } | 580 } |
581 | 581 |
582 private: | 582 private: |
583 // MetadataDatabase is normally used on the worker thread. | 583 // MetadataDatabase is normally used on the worker thread. |
584 // Use this only when there is no task running on the worker. | 584 // Use this only when there is no task running on the worker. |
585 MetadataDatabase* metadata_database() { | 585 MetadataDatabase* metadata_database() { |
586 return remote_sync_service_->sync_worker_ | 586 SyncWorker* worker = static_cast<SyncWorker*>( |
587 ->context_->metadata_database_.get(); | 587 remote_sync_service_->sync_worker_.get()); |
| 588 return worker->context_->metadata_database_.get(); |
588 } | 589 } |
589 | 590 |
590 content::TestBrowserThreadBundle thread_bundle_; | 591 content::TestBrowserThreadBundle thread_bundle_; |
591 | 592 |
592 base::ScopedTempDir base_dir_; | 593 base::ScopedTempDir base_dir_; |
593 scoped_ptr<leveldb::Env> in_memory_env_; | 594 scoped_ptr<leveldb::Env> in_memory_env_; |
594 TestingProfile profile_; | 595 TestingProfile profile_; |
595 | 596 |
596 scoped_ptr<SyncEngine> remote_sync_service_; | 597 scoped_ptr<SyncEngine> remote_sync_service_; |
597 scoped_ptr<LocalFileSyncService> local_sync_service_; | 598 scoped_ptr<LocalFileSyncService> local_sync_service_; |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 | 1690 |
1690 EXPECT_EQ(1u, CountApp()); | 1691 EXPECT_EQ(1u, CountApp()); |
1691 EXPECT_EQ(1u, CountLocalFile(app_id)); | 1692 EXPECT_EQ(1u, CountLocalFile(app_id)); |
1692 | 1693 |
1693 EXPECT_EQ(2u, CountMetadata()); | 1694 EXPECT_EQ(2u, CountMetadata()); |
1694 EXPECT_EQ(2u, CountTracker()); | 1695 EXPECT_EQ(2u, CountTracker()); |
1695 } | 1696 } |
1696 | 1697 |
1697 } // namespace drive_backend | 1698 } // namespace drive_backend |
1698 } // namespace sync_file_system | 1699 } // namespace sync_file_system |
OLD | NEW |