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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_COMMON_MEDIA_GALLERIES_PMP_TEST_UTIL_H_ 6 #define CHROME_COMMON_MEDIA_GALLERIES_PMP_TEST_UTIL_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "base/basictypes.h" 12 #include "base/files/file_path.h" 13 #include "base/files/scoped_temp_dir.h" 14 #include "chrome/common/media_galleries/pmp_constants.h" 15 16 namespace picasa { 17 18 namespace PmpTestUtil { 19 20 bool WriteIndicatorFile( 21 const base::FilePath& column_file_destination, 22 const std::string& table_name); 23 24 template<class T> 25 bool WriteColumnFileFromVector( 26 const base::FilePath& column_file_destination, 27 const std::string& table_name, 28 const std::string& column_name, 29 const PmpFieldType field_type, 30 const std::vector<T>& elements_vector); 31 32 std::vector<char> MakeHeader(const PmpFieldType field_type, 33 const uint32 row_count); 34 35 template<class T> 36 std::vector<char> MakeHeaderAndBody(const PmpFieldType field_type, 37 const uint32 row_count, 38 const std::vector<T>& elems); 39 40 } // namespace PmpTestUtil 41 42 } // namespace picasa 43 44 #endif // CHROME_COMMON_MEDIA_GALLERIES_PMP_TEST_UTIL_H_ 45