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/google_apis/drive_api_parser.h" | 5 #include "chrome/browser/google_apis/drive_api_parser.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/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 const ChangeResource& change4 = *changelist->items()[3]; | 402 const ChangeResource& change4 = *changelist->items()[3]; |
403 EXPECT_EQ(8430, change4.change_id()); | 403 EXPECT_EQ(8430, change4.change_id()); |
404 EXPECT_EQ("ABCv7G8yEYAWHc3Y5X0hMSkJYXYZ", change4.file_id()); | 404 EXPECT_EQ("ABCv7G8yEYAWHc3Y5X0hMSkJYXYZ", change4.file_id()); |
405 EXPECT_TRUE(change4.is_deleted()); | 405 EXPECT_TRUE(change4.is_deleted()); |
406 | 406 |
407 scoped_ptr<ResourceEntry> entry4( | 407 scoped_ptr<ResourceEntry> entry4( |
408 ResourceEntry::CreateFromChangeResource(change4)); | 408 ResourceEntry::CreateFromChangeResource(change4)); |
409 EXPECT_EQ(change4.file_id(), entry4->resource_id()); | 409 EXPECT_EQ(change4.file_id(), entry4->resource_id()); |
410 EXPECT_EQ(change4.is_deleted(), entry4->deleted()); | 410 EXPECT_EQ(change4.is_deleted(), entry4->deleted()); |
411 } | 411 } |
| 412 |
| 413 TEST(DriveAPIParserTest, HasKind) { |
| 414 scoped_ptr<base::Value> change_list_json( |
| 415 test_util::LoadJSONFile("chromeos/drive/changelist.json")); |
| 416 scoped_ptr<base::Value> file_list_json( |
| 417 test_util::LoadJSONFile("chromeos/drive/filelist.json")); |
| 418 |
| 419 EXPECT_TRUE(ChangeList::HasChangeListKind(*change_list_json)); |
| 420 EXPECT_FALSE(ChangeList::HasChangeListKind(*file_list_json)); |
| 421 |
| 422 EXPECT_FALSE(FileList::HasFileListKind(*change_list_json)); |
| 423 EXPECT_TRUE(FileList::HasFileListKind(*file_list_json)); |
| 424 } |
412 #endif // OS_CHROMEOS | 425 #endif // OS_CHROMEOS |
413 | 426 |
414 } // namespace google_apis | 427 } // namespace google_apis |
OLD | NEW |