| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // MTPDeviceObjectEnumerator unit tests. | 5 // MTPDeviceObjectEnumerator unit tests. |
| 6 | 6 |
| 7 #include "chrome/browser/media_galleries/win/mtp_device_object_enumerator.h" | 7 #include "chrome/browser/media_galleries/win/mtp_device_object_enumerator.h" |
| 8 | 8 |
| 9 #include <stddef.h> |
| 10 #include <stdint.h> |
| 11 |
| 9 #include <ctime> | 12 #include <ctime> |
| 10 | 13 |
| 11 #include "base/basictypes.h" | 14 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 13 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 14 #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" | 17 #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 19 |
| 17 namespace { | 20 namespace { |
| 18 | 21 |
| 19 struct MTPDeviceObjectEntryData { | 22 struct MTPDeviceObjectEntryData { |
| 20 // Friendly name of the object, e.g. "IMG_9911.jpeg". | 23 // Friendly name of the object, e.g. "IMG_9911.jpeg". |
| 21 base::string16 name; | 24 base::string16 name; |
| 22 | 25 |
| 23 // The object identifier, e.g. "o299". | 26 // The object identifier, e.g. "o299". |
| 24 base::string16 object_id; | 27 base::string16 object_id; |
| 25 | 28 |
| 26 // True if the current object is a directory/folder/album content type. | 29 // True if the current object is a directory/folder/album content type. |
| 27 bool is_directory; | 30 bool is_directory; |
| 28 | 31 |
| 29 // The object file size in bytes, e.g. "882992". | 32 // The object file size in bytes, e.g. "882992". |
| 30 int64 size; | 33 int64_t size; |
| 31 | 34 |
| 32 // Last modified time of the object. | 35 // Last modified time of the object. |
| 33 time_t last_modified_time; | 36 time_t last_modified_time; |
| 34 }; | 37 }; |
| 35 | 38 |
| 36 const MTPDeviceObjectEntryData kTestCases[] = { | 39 const MTPDeviceObjectEntryData kTestCases[] = { |
| 37 { L"File_1", L"o100", false, 10023, 1121 }, | 40 { L"File_1", L"o100", false, 10023, 1121 }, |
| 38 { L"Directory_1", L"o52", true, 99833, 2231 }, | 41 { L"Directory_1", L"o52", true, 99833, 2231 }, |
| 39 { L"File_2", L"o230", false, 8733, 7372 }, | 42 { L"File_2", L"o230", false, 8733, 7372 }, |
| 40 }; | 43 }; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 enumerator.LastModifiedTime().ToTimeT()); | 86 enumerator.LastModifiedTime().ToTimeT()); |
| 84 } | 87 } |
| 85 TestNextEntryIsEmpty(&enumerator); | 88 TestNextEntryIsEmpty(&enumerator); |
| 86 TestNextEntryIsEmpty(&enumerator); | 89 TestNextEntryIsEmpty(&enumerator); |
| 87 TestEnumeratorIsEmpty(&enumerator); | 90 TestEnumeratorIsEmpty(&enumerator); |
| 88 TestNextEntryIsEmpty(&enumerator); | 91 TestNextEntryIsEmpty(&enumerator); |
| 89 TestEnumeratorIsEmpty(&enumerator); | 92 TestEnumeratorIsEmpty(&enumerator); |
| 90 } | 93 } |
| 91 | 94 |
| 92 } // namespace | 95 } // namespace |
| OLD | NEW |