Chromium Code Reviews| Index: media/gpu/video_decode_accelerator_unittest.cc |
| diff --git a/media/gpu/video_decode_accelerator_unittest.cc b/media/gpu/video_decode_accelerator_unittest.cc |
| index 16f528e93d469753863e73d1c45a9279546442a5..76fc18c6b21bba8e4d3c0d0d484fadafd5f013f9 100644 |
| --- a/media/gpu/video_decode_accelerator_unittest.cc |
| +++ b/media/gpu/video_decode_accelerator_unittest.cc |
| @@ -199,6 +199,8 @@ const int kMD5StringLength = 32; |
| base::FilePath GetTestDataFile(const base::FilePath& input_file) { |
| if (input_file.IsAbsolute()) |
| return input_file; |
| + // input_file needs to be existed, otherwise base::MakeAbsoluteFilePath will |
| + // return an empty base::FilePath. |
|
Owen Lin
2017/03/15 08:41:43
Sounds like we should fail the test and LOG(FATAL)
johnylin1
2017/03/15 14:06:16
Done.
|
| return base::MakeAbsoluteFilePath(g_test_file_path.Append(input_file)); |
| } |
| @@ -1540,11 +1542,11 @@ TEST_P(VideoDecodeAcceleratorParamTest, TestSimpleDecode) { |
| LOG(ERROR) << "Unknown thumbnails MD5: " << md5_string; |
| base::FilePath filepath(test_video_files_[0]->file_name); |
| + filepath = GetTestDataFile(filepath); |
|
Owen Lin
2017/03/15 08:41:43
I would suggest to allow user to configure the out
johnylin1
2017/03/15 14:06:15
Done.
|
| filepath = filepath.AddExtension(FILE_PATH_LITERAL(".bad_thumbnails")); |
| filepath = filepath.AddExtension(FILE_PATH_LITERAL(".png")); |
| - int num_bytes = |
| - base::WriteFile(GetTestDataFile(filepath), |
| - reinterpret_cast<char*>(&png[0]), png.size()); |
| + int num_bytes = base::WriteFile( |
| + filepath, reinterpret_cast<char*>(&png[0]), png.size()); |
| EXPECT_EQ(num_bytes, static_cast<int>(png.size())); |
| } |
| EXPECT_NE(match, golden_md5s.end()); |