OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_file_system/drive_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "chrome/browser/sync_file_system/drive/fake_api_util.h" | 8 #include "chrome/browser/sync_file_system/drive/fake_api_util.h" |
9 #include "chrome/browser/sync_file_system/drive_metadata_store.h" | 9 #include "chrome/browser/sync_file_system/drive_metadata_store.h" |
10 #include "chrome/browser/sync_file_system/sync_file_system.pb.h" | 10 #include "chrome/browser/sync_file_system/sync_file_system.pb.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 metadata_store_(NULL), | 47 metadata_store_(NULL), |
48 sync_service_(NULL) {} | 48 sync_service_(NULL) {} |
49 | 49 |
50 virtual void SetUp() OVERRIDE { | 50 virtual void SetUp() OVERRIDE { |
51 RegisterSyncableFileSystem(); | 51 RegisterSyncableFileSystem(); |
52 fake_api_util_ = new drive::FakeAPIUtil; | 52 fake_api_util_ = new drive::FakeAPIUtil; |
53 | 53 |
54 ASSERT_TRUE(scoped_base_dir_.CreateUniqueTempDir()); | 54 ASSERT_TRUE(scoped_base_dir_.CreateUniqueTempDir()); |
55 base_dir_ = scoped_base_dir_.path(); | 55 base_dir_ = scoped_base_dir_.path(); |
56 metadata_store_ = new DriveMetadataStore( | 56 metadata_store_ = new DriveMetadataStore( |
57 base_dir_, | 57 base_dir_, base::MessageLoopProxy::current().get()); |
58 base::MessageLoopProxy::current()); | |
59 bool done = false; | 58 bool done = false; |
60 metadata_store_->Initialize(base::Bind(&DidInitialize, &done)); | 59 metadata_store_->Initialize(base::Bind(&DidInitialize, &done)); |
61 message_loop_.RunUntilIdle(); | 60 message_loop_.RunUntilIdle(); |
62 metadata_store_->SetSyncRootDirectory(kSyncRootResourceId); | 61 metadata_store_->SetSyncRootDirectory(kSyncRootResourceId); |
63 EXPECT_TRUE(done); | 62 EXPECT_TRUE(done); |
64 | 63 |
65 sync_service_ = DriveFileSyncService::CreateForTesting( | 64 sync_service_ = DriveFileSyncService::CreateForTesting( |
66 &profile_, | 65 &profile_, |
67 base_dir_, | 66 base_dir_, |
68 scoped_ptr<drive::APIUtilInterface>(fake_api_util_), | 67 scoped_ptr<drive::APIUtilInterface>(fake_api_util_), |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 ASSERT_EQ(6u, origin_status_map.size()); | 243 ASSERT_EQ(6u, origin_status_map.size()); |
245 EXPECT_EQ("Pending", origin_status_map[GURL("chrome-extension://app_p0")]); | 244 EXPECT_EQ("Pending", origin_status_map[GURL("chrome-extension://app_p0")]); |
246 EXPECT_EQ("Pending", origin_status_map[GURL("chrome-extension://app_p1")]); | 245 EXPECT_EQ("Pending", origin_status_map[GURL("chrome-extension://app_p1")]); |
247 EXPECT_EQ("Pending", origin_status_map[GURL("chrome-extension://app_p2")]); | 246 EXPECT_EQ("Pending", origin_status_map[GURL("chrome-extension://app_p2")]); |
248 EXPECT_EQ("Enabled", origin_status_map[GURL("chrome-extension://app_e0")]); | 247 EXPECT_EQ("Enabled", origin_status_map[GURL("chrome-extension://app_e0")]); |
249 EXPECT_EQ("Enabled", origin_status_map[GURL("chrome-extension://app_e1")]); | 248 EXPECT_EQ("Enabled", origin_status_map[GURL("chrome-extension://app_e1")]); |
250 EXPECT_EQ("Disabled", origin_status_map[GURL("chrome-extension://app_d0")]); | 249 EXPECT_EQ("Disabled", origin_status_map[GURL("chrome-extension://app_d0")]); |
251 } | 250 } |
252 | 251 |
253 } // namespace sync_file_system | 252 } // namespace sync_file_system |
OLD | NEW |