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

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

Issue 10332253: gdata: Define the resource ID for the root directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a test Created 8 years, 7 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 | « no previous file | chrome/browser/chromeos/gdata/gdata_files.h » ('j') | 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 4
5 #include <errno.h> 5 #include <errno.h>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 // Creates a proto file representing a filesystem with directories: 993 // Creates a proto file representing a filesystem with directories:
994 // drive, drive/Dir1, drive/Dir1/SubDir2 994 // drive, drive/Dir1, drive/Dir1/SubDir2
995 // and files 995 // and files
996 // drive/File1, drive/Dir1/File2, drive/Dir1/SubDir2/File3 996 // drive/File1, drive/Dir1/File2, drive/Dir1/SubDir2/File3
997 void SaveTestFileSystem() { 997 void SaveTestFileSystem() {
998 GDataRootDirectoryProto root; 998 GDataRootDirectoryProto root;
999 GDataDirectoryProto* root_dir = root.mutable_gdata_directory(); 999 GDataDirectoryProto* root_dir = root.mutable_gdata_directory();
1000 GDataEntryProto* file_base = root_dir->mutable_gdata_entry(); 1000 GDataEntryProto* file_base = root_dir->mutable_gdata_entry();
1001 PlatformFileInfoProto* platform_info = file_base->mutable_file_info(); 1001 PlatformFileInfoProto* platform_info = file_base->mutable_file_info();
1002 file_base->set_title("drive"); 1002 file_base->set_title("drive");
1003 file_base->set_resource_id(kGDataRootDirectoryResourceId);
1003 platform_info->set_is_directory(true); 1004 platform_info->set_is_directory(true);
1004 1005
1005 // drive/File1 1006 // drive/File1
1006 GDataFileProto* file = root_dir->add_child_files(); 1007 GDataFileProto* file = root_dir->add_child_files();
1007 file_base = file->mutable_gdata_entry(); 1008 file_base = file->mutable_gdata_entry();
1008 platform_info = file_base->mutable_file_info(); 1009 platform_info = file_base->mutable_file_info();
1009 file_base->set_title("File1"); 1010 file_base->set_title("File1");
1010 platform_info->set_is_directory(false); 1011 platform_info->set_is_directory(false);
1011 platform_info->set_size(1048576); 1012 platform_info->set_size(1048576);
1012 1013
(...skipping 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after
3655 EXPECT_EQ(1, num_callback_invocations_); 3656 EXPECT_EQ(1, num_callback_invocations_);
3656 EXPECT_TRUE(CacheEntryExists(resource_id, md5)); 3657 EXPECT_TRUE(CacheEntryExists(resource_id, md5));
3657 3658
3658 // Try to remove the file. 3659 // Try to remove the file.
3659 num_callback_invocations_ = 0; 3660 num_callback_invocations_ = 0;
3660 TestRemoveFromCache(resource_id, base::PLATFORM_FILE_OK); 3661 TestRemoveFromCache(resource_id, base::PLATFORM_FILE_OK);
3661 EXPECT_EQ(1, num_callback_invocations_); 3662 EXPECT_EQ(1, num_callback_invocations_);
3662 } 3663 }
3663 3664
3664 } // namespace gdata 3665 } // namespace gdata
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_files.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698