| 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..cd496d8df28be47e329ebf3f66d02471febde730
|
| --- /dev/null
|
| +++ b/webkit/fileapi/media/picasa/pmp_test_helper.h
|
| @@ -0,0 +1,45 @@
|
| +// 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"
|
| +
|
| +namespace base {
|
| +
|
| +class FilePath;
|
| +
|
| +} // namespace base
|
| +
|
| +namespace fileapi {
|
| +
|
| +// A helper class used for unit tests only
|
| +class PmpTestHelper {
|
| + public:
|
| + 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);
|
| +
|
| + static bool WriteToFile(const base::FilePath& path, std::vector<uint8> data);
|
| +
|
| + private:
|
| + // Flatten a vector of elements into an array of bytes.
|
| + template<class T>
|
| + static std::vector<uint8> Flatten(const std::vector<T>& elems);
|
| +
|
| + // Returns a new vector with the concatenated contents of |a| and |b|.
|
| + static std::vector<uint8> CombinedVectors(const std::vector<uint8>& a,
|
| + const std::vector<uint8>& b);
|
| +};
|
| +
|
| +} // namespace fileapi
|
| +
|
| +#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_
|
|
|