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 "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/json/json_file_value_serializer.h" | 7 #include "base/json/json_file_value_serializer.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 | 163 |
164 ASSERT_EQ(3U, filelist->items().size()); | 164 ASSERT_EQ(3U, filelist->items().size()); |
165 // Check file 1 (a regular file) | 165 // Check file 1 (a regular file) |
166 const FileResource& file1 = *filelist->items()[0]; | 166 const FileResource& file1 = *filelist->items()[0]; |
167 EXPECT_EQ("0B4v7G8yEYAWHUmRrU2lMS2hLABC", file1.file_id()); | 167 EXPECT_EQ("0B4v7G8yEYAWHUmRrU2lMS2hLABC", file1.file_id()); |
168 EXPECT_EQ("\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/MTM0MzM2NzgwMDIXYZ\"", | 168 EXPECT_EQ("\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/MTM0MzM2NzgwMDIXYZ\"", |
169 file1.etag()); | 169 file1.etag()); |
170 EXPECT_EQ("My first file data", file1.title()); | 170 EXPECT_EQ("My first file data", file1.title()); |
171 EXPECT_EQ("application/octet-stream", file1.mime_type()); | 171 EXPECT_EQ("application/octet-stream", file1.mime_type()); |
172 | 172 |
173 EXPECT_FALSE(file1.labels().is_starred()); | |
174 EXPECT_FALSE(file1.labels().is_hidden()); | |
175 EXPECT_FALSE(file1.labels().is_trashed()); | |
176 EXPECT_FALSE(file1.labels().is_restricted()); | |
177 EXPECT_TRUE(file1.labels().is_viewed()); | |
hashimoto
2012/08/14 02:23:10
Could you add tests to ensure that other four gett
kochi
2012/08/14 02:32:12
Done.
| |
178 | |
173 base::Time created_time; | 179 base::Time created_time; |
174 ASSERT_TRUE(gdata::util::GetTimeFromString("2012-07-24T08:51:16.570Z", | 180 ASSERT_TRUE(gdata::util::GetTimeFromString("2012-07-24T08:51:16.570Z", |
175 &created_time)); | 181 &created_time)); |
176 EXPECT_EQ(created_time, file1.created_date()); | 182 EXPECT_EQ(created_time, file1.created_date()); |
177 | 183 |
178 base::Time modified_time; | 184 base::Time modified_time; |
179 ASSERT_TRUE(gdata::util::GetTimeFromString("2012-07-27T05:43:20.269Z", | 185 ASSERT_TRUE(gdata::util::GetTimeFromString("2012-07-27T05:43:20.269Z", |
180 &modified_time)); | 186 &modified_time)); |
181 EXPECT_EQ(modified_time, file1.modified_by_me_date()); | 187 EXPECT_EQ(modified_time, file1.modified_by_me_date()); |
182 | 188 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 EXPECT_FALSE(change2.is_deleted()); | 264 EXPECT_FALSE(change2.is_deleted()); |
259 EXPECT_EQ(change2.file_id(), change2.file().file_id()); | 265 EXPECT_EQ(change2.file_id(), change2.file().file_id()); |
260 | 266 |
261 const ChangeResource& change3 = *changelist->items()[2]; | 267 const ChangeResource& change3 = *changelist->items()[2]; |
262 EXPECT_EQ(8429, change3.change_id()); | 268 EXPECT_EQ(8429, change3.change_id()); |
263 EXPECT_FALSE(change3.is_deleted()); | 269 EXPECT_FALSE(change3.is_deleted()); |
264 EXPECT_EQ(change3.file_id(), change3.file().file_id()); | 270 EXPECT_EQ(change3.file_id(), change3.file().file_id()); |
265 } | 271 } |
266 | 272 |
267 } // namespace gdata | 273 } // namespace gdata |
OLD | NEW |