Chromium Code Reviews| Index: webkit/fileapi/media/picasa/pmp_test_helper.h |
| diff --git a/webkit/fileapi/media/picasa/pmp_test_helper.h b/webkit/fileapi/media/picasa/pmp_test_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e8f2290009c360757df7bf8b722c4e9963c92156 |
| --- /dev/null |
| +++ b/webkit/fileapi/media/picasa/pmp_test_helper.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ |
| +#define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/files/scoped_temp_dir.h" |
| + |
| +namespace base { |
| + |
| +class FilePath; |
| + |
| +} // namespace base |
|
kinuko
2013/04/10 02:27:54
nit: for forward decl you can compress empty lines
tommycli
2013/04/10 18:32:42
Done.
|
| + |
| +namespace picasaimport { |
| + |
| +class PmpColumnReader; |
| + |
| +// A helper class used for unit tests only |
| +class PmpTestHelper { |
| + public: |
| + PmpTestHelper(); |
| + |
| + bool Init(); |
| + |
| + base::FilePath GetTempDirPath(); |
| + |
| + template<class T> |
| + bool WriteColumnFileFromVector(std::string table_name, |
| + std::string column_name, |
| + const uint16 field_type, |
| + std::vector<T> elements_vector); |
|
kinuko
2013/04/10 02:27:54
can these params be passed by const ref?
const st
tommycli
2013/04/10 18:32:42
Done.
|
| + |
| + bool InitColumnReaderFromBytes(PmpColumnReader* const reader, |
| + std::vector<uint8> data, uint32* rows_read); |
|
kinuko
2013/04/10 02:27:54
ditto for vector<uint8>
tommycli
2013/04/10 18:32:42
Done.
|
| + |
| + static std::vector<uint8> MakeHeader(const uint16 field_type, |
| + const uint32 row_count); |
| + |
| + template<class T> |
| + static std::vector<uint8> MakeHeaderAndBody(const uint16 field_type, |
| + const uint32 row_count, |
| + const std::vector<T>& elems); |
| + |
| + private: |
| + base::ScopedTempDir temp_dir_; |
| +}; |
| + |
| +} // namespace picasaimport |
| + |
| +#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ |