Chromium Code Reviews| 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 | |
| 12 namespace base { | |
| 13 | |
| 14 class FilePath; | |
| 15 | |
| 16 } // namespace base | |
| 17 | |
| 18 namespace fileapi { | |
| 19 | |
| 20 // A helper class used for unit tests only | |
| 21 class PmpTestHelper { | |
|
vandebo (ex-Chrome)
2013/03/29 21:35:07
You might want to make this a functional class.
I
tommycli
2013/04/01 22:19:18
I could see that being useful. I'll do it if I add
vandebo (ex-Chrome)
2013/04/02 18:10:55
But what if you're not the next one to add a test?
tommycli
2013/04/02 21:12:36
Oh. That's a good point. I'll clean it up then.
| |
| 22 public: | |
| 23 static std::vector<uint8> MakeHeader(const uint16 field_type, | |
| 24 const uint32 row_count); | |
| 25 | |
| 26 template<class T> | |
| 27 static std::vector<uint8> MakeHeaderAndBody(const uint16 field_type, | |
| 28 const uint32 row_count, | |
| 29 const std::vector<T>& elems); | |
| 30 | |
| 31 static bool WriteToFile(const base::FilePath& path, std::vector<uint8> data); | |
| 32 | |
| 33 private: | |
| 34 // Flatten a vector of elements into an array of bytes. | |
| 35 template<class T> | |
| 36 static std::vector<uint8> Flatten(const std::vector<T>& elems); | |
| 37 | |
| 38 // Returns a new vector with the concatenated contents of |a| and |b|. | |
| 39 static std::vector<uint8> CombinedVectors(const std::vector<uint8>& a, | |
| 40 const std::vector<uint8>& b); | |
| 41 }; | |
| 42 | |
| 43 } // namespace fileapi | |
| 44 | |
| 45 #endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ | |
| OLD | NEW |