Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Side by Side Diff: chrome/utility/media_galleries/pmp_column_reader_unittest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
(...skipping 12 matching lines...) Expand all
23 const PmpFieldType expected_type) { 23 const PmpFieldType expected_type) {
24 base::ScopedTempDir temp_dir; 24 base::ScopedTempDir temp_dir;
25 if (!temp_dir.CreateUniqueTempDir()) 25 if (!temp_dir.CreateUniqueTempDir())
26 return false; 26 return false;
27 27
28 base::FilePath temp_path; 28 base::FilePath temp_path;
29 if (!base::CreateTemporaryFileInDir(temp_dir.path(), &temp_path)) 29 if (!base::CreateTemporaryFileInDir(temp_dir.path(), &temp_path))
30 return false; 30 return false;
31 31
32 // Explicit conversion from signed to unsigned. 32 // Explicit conversion from signed to unsigned.
33 size_t bytes_written = file_util::WriteFile(temp_path, &data[0], data.size()); 33 size_t bytes_written = base::WriteFile(temp_path, &data[0], data.size());
34 if (bytes_written != data.size()) 34 if (bytes_written != data.size())
35 return false; 35 return false;
36 36
37 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; 37 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ;
38 base::PlatformFile platform_file = 38 base::PlatformFile platform_file =
39 base::CreatePlatformFile(temp_path, flags, NULL, NULL); 39 base::CreatePlatformFile(temp_path, flags, NULL, NULL);
40 if (platform_file == base::kInvalidPlatformFileValue) 40 if (platform_file == base::kInvalidPlatformFileValue)
41 return false; 41 return false;
42 42
43 bool read_success = reader->ReadFile(platform_file, expected_type); 43 bool read_success = reader->ReadFile(platform_file, expected_type);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 TEST(PmpColumnReaderTest, PrimitiveParsing) { 202 TEST(PmpColumnReaderTest, PrimitiveParsing) {
203 TestPrimitive<uint32>(PMP_TYPE_UINT32); 203 TestPrimitive<uint32>(PMP_TYPE_UINT32);
204 TestPrimitive<double>(PMP_TYPE_DOUBLE64); 204 TestPrimitive<double>(PMP_TYPE_DOUBLE64);
205 TestPrimitive<uint8>(PMP_TYPE_UINT8); 205 TestPrimitive<uint8>(PMP_TYPE_UINT8);
206 TestPrimitive<uint64>(PMP_TYPE_UINT64); 206 TestPrimitive<uint64>(PMP_TYPE_UINT64);
207 } 207 }
208 208
209 } // namespace 209 } // namespace
210 210
211 } // namespace picasa 211 } // namespace picasa
OLDNEW
« no previous file with comments | « chrome/utility/image_writer/image_writer_unittest.cc ('k') | chromeos/dbus/cros_disks_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698