OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |