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 #include <string> | 4 #include <string> |
5 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 // Existing folder. | 432 // Existing folder. |
433 EXPECT_EQ( | 433 EXPECT_EQ( |
434 file_system_->FindFirstMissingParentDirectory( | 434 file_system_->FindFirstMissingParentDirectory( |
435 FilePath("gdata/Directory 1"), | 435 FilePath("gdata/Directory 1"), |
436 &last_dir_content_url, | 436 &last_dir_content_url, |
437 &first_missing_parent_path), | 437 &first_missing_parent_path), |
438 GDataFileSystem::DIRECTORY_ALREADY_PRESENT); | 438 GDataFileSystem::DIRECTORY_ALREADY_PRESENT); |
439 } | 439 } |
440 | 440 |
| 441 // TODO(satorux): Write a test for GetFile() once DocumentsService is |
| 442 // mockable. |
| 443 |
| 444 TEST_F(GDataFileSystemTest, GetGDataFileInfoFromPath) { |
| 445 LoadRootFeedDocument("root_feed.json"); |
| 446 |
| 447 GDataFileBase* file_info = file_system_->GetGDataFileInfoFromPath( |
| 448 FilePath(FILE_PATH_LITERAL("gdata/File 1.txt"))); |
| 449 ASSERT_TRUE(file_info != NULL); |
| 450 EXPECT_EQ("https://file_link_self/", file_info->self_url().spec()); |
| 451 EXPECT_EQ("https://file_content_url/", file_info->content_url().spec()); |
| 452 |
| 453 GDataFileBase* non_existent = file_system_->GetGDataFileInfoFromPath( |
| 454 FilePath(FILE_PATH_LITERAL("gdata/Nonexistent.txt"))); |
| 455 ASSERT_TRUE(non_existent == NULL); |
| 456 } |
| 457 |
441 } // namespace gdata | 458 } // namespace gdata |
OLD | NEW |