Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: webkit/fileapi/media/picasa/pmp_table_reader_unittest.cc

Issue 13529028: PicasaAlbumTableReader for Media Galleries API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0005-picasa-import-pmp-reader
Patch Set: Rename PicasaAlbumDataReader => PicasaAlbumTableReader Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 ASSERT_TRUE(test_helper.WriteColumnFileFromVector( 49 ASSERT_TRUE(test_helper.WriteColumnFileFromVector(
50 table_name, column_names[0], column_field_types[0], strings_vector)); 50 table_name, column_names[0], column_field_types[0], strings_vector));
51 51
52 ASSERT_TRUE(test_helper.WriteColumnFileFromVector( 52 ASSERT_TRUE(test_helper.WriteColumnFileFromVector(
53 table_name, column_names[1], column_field_types[1], uint32s_vector)); 53 table_name, column_names[1], column_field_types[1], uint32s_vector));
54 54
55 ASSERT_TRUE(test_helper.WriteColumnFileFromVector( 55 ASSERT_TRUE(test_helper.WriteColumnFileFromVector(
56 table_name, column_names[2], column_field_types[2], doubles_vector)); 56 table_name, column_names[2], column_field_types[2], doubles_vector));
57 57
58 picasaimport::PmpTableReader table_reader; 58 picasaimport::PmpTableReader table_reader(table_name,
59 ASSERT_TRUE(table_reader.Init( 59 test_helper.GetTempDirPath());
60 table_name, test_helper.GetTempDirPath(), column_names)); 60
61 for (unsigned int i = 0; i < column_names.size(); i++) {
62 ASSERT_TRUE(
63 table_reader.AddColumn(column_names[i], column_field_types[i]) != NULL);
64 }
61 65
62 EXPECT_EQ(max_rows, table_reader.RowCount()); 66 EXPECT_EQ(max_rows, table_reader.RowCount());
63
64 const std::vector<const picasaimport::PmpColumnReader*> column_readers =
65 table_reader.GetColumns();
66
67 for (int i = 0; i < 3; i++) {
68 EXPECT_EQ(column_field_types[i], column_readers[i]->field_type());
69 }
70 } 67 }
71 68
72 } // namespace 69 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698