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 "components/drive/resource_entry_conversion.h" | 5 #include "components/drive/resource_entry_conversion.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "components/drive/drive.pb.h" | 9 #include "components/drive/drive.pb.h" |
10 #include "components/drive/drive_api_util.h" | 10 #include "components/drive/drive_api_util.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 ResourceEntry entry; | 386 ResourceEntry entry; |
387 std::string parent_resource_id; | 387 std::string parent_resource_id; |
388 EXPECT_TRUE(ConvertFileResourceToResourceEntry( | 388 EXPECT_TRUE(ConvertFileResourceToResourceEntry( |
389 entry_no_fields, &entry, &parent_resource_id)); | 389 entry_no_fields, &entry, &parent_resource_id)); |
390 EXPECT_FALSE(entry.file_specific_info().has_image_width()); | 390 EXPECT_FALSE(entry.file_specific_info().has_image_width()); |
391 EXPECT_FALSE(entry.file_specific_info().has_image_height()); | 391 EXPECT_FALSE(entry.file_specific_info().has_image_height()); |
392 EXPECT_FALSE(entry.file_specific_info().has_image_rotation()); | 392 EXPECT_FALSE(entry.file_specific_info().has_image_rotation()); |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
| 396 TEST(ResourceEntryConversionTest, ConvertChangeResourceToTeamDriveChange) { |
| 397 google_apis::ChangeResource change_resource; |
| 398 change_resource.set_type(google_apis::ChangeResource::TEAM_DRIVE); |
| 399 change_resource.set_team_drive( |
| 400 base::WrapUnique(new google_apis::TeamDriveResource)); |
| 401 change_resource.set_team_drive_id("team_drive_id"); |
| 402 change_resource.set_modification_date(GetTestTime()); |
| 403 |
| 404 google_apis::TeamDriveResource* team_drive_resource = |
| 405 change_resource.mutable_team_drive(); |
| 406 team_drive_resource->set_name("ABC Team Drive"); |
| 407 team_drive_resource->set_id("team_drive_id"); |
| 408 |
| 409 TeamDriveChange team_drive_change; |
| 410 EXPECT_TRUE(ConvertChangeResourceToTeamDriveChange(change_resource, |
| 411 &team_drive_change)); |
| 412 |
| 413 EXPECT_EQ(change_resource.team_drive_id(), team_drive_change.id()); |
| 414 EXPECT_EQ(team_drive_resource->name(), team_drive_change.name()); |
| 415 EXPECT_EQ(change_resource.modification_date().ToInternalValue(), |
| 416 team_drive_change.modification_date()); |
| 417 } |
| 418 |
396 } // namespace drive | 419 } // namespace drive |
OLD | NEW |