Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc

Issue 9583031: gdata:: Add GDataFileSystem::GetFile(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698