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

Unified Diff: media/gpu/video_decode_accelerator_unittest.cc

Issue 2753773002: Fix failed to write thumbnail png issue (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698