OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include <stdint.h> |
| 6 |
5 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
6 #include "chrome/common/media_galleries/picasa_test_util.h" | 8 #include "chrome/common/media_galleries/picasa_test_util.h" |
7 #include "chrome/common/media_galleries/pmp_constants.h" | 9 #include "chrome/common/media_galleries/pmp_constants.h" |
8 #include "chrome/utility/media_galleries/picasa_album_table_reader.h" | 10 #include "chrome/utility/media_galleries/picasa_album_table_reader.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
10 | 12 |
11 namespace picasa { | 13 namespace picasa { |
12 | 14 |
13 namespace { | 15 namespace { |
14 | 16 |
15 TEST(PicasaAlbumTableReaderTest, FoldersAndAlbums) { | 17 TEST(PicasaAlbumTableReaderTest, FoldersAndAlbums) { |
16 base::ScopedTempDir temp_dir; | 18 base::ScopedTempDir temp_dir; |
17 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 19 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
18 | 20 |
19 int test_time_delta = 100; | 21 int test_time_delta = 100; |
20 | 22 |
21 std::vector<uint32> category_vector; | 23 std::vector<uint32_t> category_vector; |
22 category_vector.push_back(kAlbumCategoryFolder); | 24 category_vector.push_back(kAlbumCategoryFolder); |
23 category_vector.push_back(kAlbumCategoryInvalid); | 25 category_vector.push_back(kAlbumCategoryInvalid); |
24 category_vector.push_back(kAlbumCategoryAlbum); | 26 category_vector.push_back(kAlbumCategoryAlbum); |
25 | 27 |
26 std::vector<double> date_vector; | 28 std::vector<double> date_vector; |
27 date_vector.push_back(0.0); | 29 date_vector.push_back(0.0); |
28 date_vector.push_back(0.0); | 30 date_vector.push_back(0.0); |
29 date_vector.push_back(0.0 + test_time_delta); | 31 date_vector.push_back(0.0 + test_time_delta); |
30 | 32 |
31 std::string test_folder_name = "Pix4dalulz"; | 33 std::string test_folder_name = "Pix4dalulz"; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 EXPECT_EQ(test_folder_path, folders[0].path); | 75 EXPECT_EQ(test_folder_path, folders[0].path); |
74 | 76 |
75 base::TimeDelta time_delta = albums[0].timestamp - folders[0].timestamp; | 77 base::TimeDelta time_delta = albums[0].timestamp - folders[0].timestamp; |
76 | 78 |
77 EXPECT_EQ(test_time_delta, time_delta.InDays()); | 79 EXPECT_EQ(test_time_delta, time_delta.InDays()); |
78 } | 80 } |
79 | 81 |
80 } // namespace | 82 } // namespace |
81 | 83 |
82 } // namespace picasa | 84 } // namespace picasa |
OLD | NEW |