| OLD | NEW |
| (Empty) | |
| 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 WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ |
| 6 #define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/files/scoped_temp_dir.h" |
| 12 |
| 13 namespace base { |
| 14 |
| 15 class FilePath; |
| 16 |
| 17 } // namespace base |
| 18 |
| 19 namespace picasaimport { |
| 20 |
| 21 class PmpColumnReader; |
| 22 |
| 23 // A helper class used for unit tests only |
| 24 class PmpTestHelper { |
| 25 public: |
| 26 PmpTestHelper(); |
| 27 |
| 28 bool Init(); |
| 29 |
| 30 base::FilePath GetTempDirPath(); |
| 31 |
| 32 template<class T> |
| 33 bool WriteColumnFileFromVector(std::string table_name, |
| 34 std::string column_name, |
| 35 const uint16 field_type, |
| 36 std::vector<T> elements_vector); |
| 37 |
| 38 bool InitColumnReaderFromBytes(PmpColumnReader* const reader, |
| 39 std::vector<uint8> data, uint32* rows_read); |
| 40 |
| 41 static std::vector<uint8> MakeHeader(const uint16 field_type, |
| 42 const uint32 row_count); |
| 43 |
| 44 template<class T> |
| 45 static std::vector<uint8> MakeHeaderAndBody(const uint16 field_type, |
| 46 const uint32 row_count, |
| 47 const std::vector<T>& elems); |
| 48 |
| 49 private: |
| 50 base::ScopedTempDir temp_dir_; |
| 51 }; |
| 52 |
| 53 } // namespace picasaimport |
| 54 |
| 55 #endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ |
| OLD | NEW |