OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/utility/media_galleries/pmp_test_helper.h" | 5 #include "chrome/utility/media_galleries/pmp_test_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; | 128 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; |
129 base::PlatformFile platform_file = | 129 base::PlatformFile platform_file = |
130 base::CreatePlatformFile(temp_path, flags, NULL, NULL); | 130 base::CreatePlatformFile(temp_path, flags, NULL, NULL); |
131 if (platform_file == base::kInvalidPlatformFileValue) | 131 if (platform_file == base::kInvalidPlatformFileValue) |
132 return false; | 132 return false; |
133 | 133 |
134 bool read_success = reader->ReadFile(platform_file, expected_type); | 134 bool read_success = reader->ReadFile(platform_file, expected_type); |
135 | 135 |
136 base::ClosePlatformFile(platform_file); | 136 base::ClosePlatformFile(platform_file); |
137 file_util::Delete(temp_path, false /* recursive */); | 137 base::Delete(temp_path, false /* recursive */); |
138 | 138 |
139 return read_success; | 139 return read_success; |
140 } | 140 } |
141 | 141 |
142 // Return a vector so we don't have to worry about memory management. | 142 // Return a vector so we don't have to worry about memory management. |
143 std::vector<uint8> PmpTestHelper::MakeHeader(const PmpFieldType field_type, | 143 std::vector<uint8> PmpTestHelper::MakeHeader(const PmpFieldType field_type, |
144 const uint32 row_count) { | 144 const uint32 row_count) { |
145 std::vector<uint8> header(picasa::kPmpHeaderSize); | 145 std::vector<uint8> header(picasa::kPmpHeaderSize); |
146 | 146 |
147 // Copy in magic bytes. | 147 // Copy in magic bytes. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<uint32>( | 181 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<uint32>( |
182 const PmpFieldType, const uint32, const std::vector<uint32>&); | 182 const PmpFieldType, const uint32, const std::vector<uint32>&); |
183 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<double>( | 183 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<double>( |
184 const PmpFieldType, const uint32, const std::vector<double>&); | 184 const PmpFieldType, const uint32, const std::vector<double>&); |
185 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<uint8>( | 185 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<uint8>( |
186 const PmpFieldType, const uint32, const std::vector<uint8>&); | 186 const PmpFieldType, const uint32, const std::vector<uint8>&); |
187 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<uint64>( | 187 template std::vector<uint8> PmpTestHelper::MakeHeaderAndBody<uint64>( |
188 const PmpFieldType, const uint32, const std::vector<uint64>&); | 188 const PmpFieldType, const uint32, const std::vector<uint64>&); |
189 | 189 |
190 } // namespace picasa | 190 } // namespace picasa |
OLD | NEW |