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/chromeos/drive/sync_client.h" | 5 #include "chrome/browser/chromeos/drive/sync_client.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 base::RunLoop().RunUntilIdle(); | 145 base::RunLoop().RunUntilIdle(); |
146 ASSERT_EQ(google_apis::HTTP_CREATED, error); | 146 ASSERT_EQ(google_apis::HTTP_CREATED, error); |
147 ASSERT_TRUE(entry); | 147 ASSERT_TRUE(entry); |
148 resource_ids_[title] = entry->resource_id(); | 148 resource_ids_[title] = entry->resource_id(); |
149 } | 149 } |
150 | 150 |
151 // Sets up data for tests. | 151 // Sets up data for tests. |
152 void SetUpTestData() { | 152 void SetUpTestData() { |
153 // Prepare a temp file. | 153 // Prepare a temp file. |
154 base::FilePath temp_file; | 154 base::FilePath temp_file; |
155 EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), | 155 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file)); |
156 &temp_file)); | |
157 ASSERT_TRUE(google_apis::test_util::WriteStringToFile(temp_file, | 156 ASSERT_TRUE(google_apis::test_util::WriteStringToFile(temp_file, |
158 kLocalContent)); | 157 kLocalContent)); |
159 | 158 |
160 // Add file entries to the service. | 159 // Add file entries to the service. |
161 ASSERT_NO_FATAL_FAILURE(AddFileEntry("foo")); | 160 ASSERT_NO_FATAL_FAILURE(AddFileEntry("foo")); |
162 ASSERT_NO_FATAL_FAILURE(AddFileEntry("bar")); | 161 ASSERT_NO_FATAL_FAILURE(AddFileEntry("bar")); |
163 ASSERT_NO_FATAL_FAILURE(AddFileEntry("baz")); | 162 ASSERT_NO_FATAL_FAILURE(AddFileEntry("baz")); |
164 ASSERT_NO_FATAL_FAILURE(AddFileEntry("fetched")); | 163 ASSERT_NO_FATAL_FAILURE(AddFileEntry("fetched")); |
165 ASSERT_NO_FATAL_FAILURE(AddFileEntry("dirty")); | 164 ASSERT_NO_FATAL_FAILURE(AddFileEntry("dirty")); |
166 ASSERT_NO_FATAL_FAILURE(AddFileEntry("removed")); | 165 ASSERT_NO_FATAL_FAILURE(AddFileEntry("removed")); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 387 |
389 // Fetched and uploaded. | 388 // Fetched and uploaded. |
390 EXPECT_TRUE(cache_->GetCacheEntry(GetLocalId("foo"), &cache_entry)); | 389 EXPECT_TRUE(cache_->GetCacheEntry(GetLocalId("foo"), &cache_entry)); |
391 EXPECT_TRUE(cache_entry.is_present()); | 390 EXPECT_TRUE(cache_entry.is_present()); |
392 EXPECT_TRUE(cache_->GetCacheEntry(GetLocalId("dirty"), &cache_entry)); | 391 EXPECT_TRUE(cache_->GetCacheEntry(GetLocalId("dirty"), &cache_entry)); |
393 EXPECT_FALSE(cache_entry.is_dirty()); | 392 EXPECT_FALSE(cache_entry.is_dirty()); |
394 } | 393 } |
395 | 394 |
396 } // namespace internal | 395 } // namespace internal |
397 } // namespace drive | 396 } // namespace drive |
OLD | NEW |