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

Side by Side Diff: media/base/yuv_convert_unittest.cc

Issue 102873002: Move GetFileSize, NormalizeFilePath to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « media/base/test_data_util.cc ('k') | net/base/file_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/cpu.h" 6 #include "base/cpu.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "media/base/djb2.h" 10 #include "media/base/djb2.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 base::FilePath path; 45 base::FilePath path;
46 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &path)); 46 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &path));
47 path = path.Append(FILE_PATH_LITERAL("media")) 47 path = path.Append(FILE_PATH_LITERAL("media"))
48 .Append(FILE_PATH_LITERAL("test")) 48 .Append(FILE_PATH_LITERAL("test"))
49 .Append(FILE_PATH_LITERAL("data")) 49 .Append(FILE_PATH_LITERAL("data"))
50 .Append(filename); 50 .Append(filename);
51 51
52 // Verify file size is correct. 52 // Verify file size is correct.
53 int64 actual_size = 0; 53 int64 actual_size = 0;
54 file_util::GetFileSize(path, &actual_size); 54 base::GetFileSize(path, &actual_size);
55 CHECK_EQ(actual_size, expected_size); 55 CHECK_EQ(actual_size, expected_size);
56 56
57 // Verify bytes read are correct. 57 // Verify bytes read are correct.
58 int bytes_read = file_util::ReadFile( 58 int bytes_read = file_util::ReadFile(
59 path, reinterpret_cast<char*>(data->get()), expected_size); 59 path, reinterpret_cast<char*>(data->get()), expected_size);
60 CHECK_EQ(bytes_read, expected_size); 60 CHECK_EQ(bytes_read, expected_size);
61 } 61 }
62 62
63 static void ReadYV12Data(scoped_ptr<uint8[]>* data) { 63 static void ReadYV12Data(scoped_ptr<uint8[]>* data) {
64 ReadData(FILE_PATH_LITERAL("bali_640x360_P420.yuv"), kYUV12Size, data); 64 ReadData(FILE_PATH_LITERAL("bali_640x360_P420.yuv"), kYUV12Size, data);
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), 961 EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
962 rgb_bytes_converted.get(), 962 rgb_bytes_converted.get(),
963 kWidth * kBpp)); 963 kWidth * kBpp));
964 } 964 }
965 965
966 #endif // defined(ARCH_CPU_X86_64) 966 #endif // defined(ARCH_CPU_X86_64)
967 967
968 #endif // defined(ARCH_CPU_X86_FAMILY) 968 #endif // defined(ARCH_CPU_X86_FAMILY)
969 969
970 } // namespace media 970 } // namespace media
OLDNEW
« no previous file with comments | « media/base/test_data_util.cc ('k') | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698