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

Unified Diff: content/renderer/media/media_recorder_handler_unittest.cc

Issue 1886123002: [experimental] MR: add support for H264 recording (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « content/renderer/media/media_recorder_handler.cc ('k') | content/renderer/media/video_track_recorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_recorder_handler_unittest.cc
diff --git a/content/renderer/media/media_recorder_handler_unittest.cc b/content/renderer/media/media_recorder_handler_unittest.cc
index 5bc99aedc203172726f6290026851a7834b68ed2..840a072299aa3754141c9d6558c902b074c26d8e 100644
--- a/content/renderer/media/media_recorder_handler_unittest.cc
+++ b/content/renderer/media/media_recorder_handler_unittest.cc
@@ -22,6 +22,7 @@
using ::testing::_;
using ::testing::AtLeast;
using ::testing::InSequence;
+using ::testing::Ge;
using ::testing::Gt;
using ::testing::Lt;
using ::testing::Mock;
@@ -59,6 +60,7 @@ struct MediaRecorderTestParams {
static const MediaRecorderTestParams kMediaRecorderTestParams[] = {
{true, false, "video/webm", "vp8"},
{true, false, "video/webm", "vp9"},
+ {true, false, "video/webm", "h264"},
{false, true, "video/webm", "vp8"}};
class MediaRecorderHandlerTest : public TestWithParam<MediaRecorderTestParams>,
@@ -156,6 +158,9 @@ TEST_F(MediaRecorderHandlerTest, CanSupportMimeType) {
const WebString example_good_codecs_3(base::UTF8ToUTF16("VP9,opus"));
EXPECT_TRUE(media_recorder_handler_->canSupportMimeType(
mime_type_video, example_good_codecs_3));
+ const WebString example_good_codecs_4(base::UTF8ToUTF16("H264,opus"));
+ EXPECT_TRUE(media_recorder_handler_->canSupportMimeType(
+ mime_type_video, example_good_codecs_4));
const WebString example_unsupported_codecs_1(base::UTF8ToUTF16("daala"));
EXPECT_FALSE(media_recorder_handler_->canSupportMimeType(
@@ -164,12 +169,12 @@ TEST_F(MediaRecorderHandlerTest, CanSupportMimeType) {
const WebString mime_type_audio(base::UTF8ToUTF16("audio/webm"));
EXPECT_TRUE(media_recorder_handler_->canSupportMimeType(
mime_type_audio, WebString()));
- const WebString example_good_codecs_4(base::UTF8ToUTF16("opus"));
- EXPECT_TRUE(media_recorder_handler_->canSupportMimeType(
- mime_type_audio, example_good_codecs_4));
- const WebString example_good_codecs_5(base::UTF8ToUTF16("OpUs"));
+ const WebString example_good_codecs_5(base::UTF8ToUTF16("opus"));
EXPECT_TRUE(media_recorder_handler_->canSupportMimeType(
mime_type_audio, example_good_codecs_5));
+ const WebString example_good_codecs_6(base::UTF8ToUTF16("OpUs"));
+ EXPECT_TRUE(media_recorder_handler_->canSupportMimeType(
+ mime_type_audio, example_good_codecs_6));
const WebString example_unsupported_codecs_2(base::UTF8ToUTF16("vorbis"));
EXPECT_FALSE(media_recorder_handler_->canSupportMimeType(
@@ -221,7 +226,7 @@ TEST_P(MediaRecorderHandlerTest, EncodeVideoFrames) {
const scoped_refptr<media::VideoFrame> video_frame =
media::VideoFrame::CreateBlackFrame(gfx::Size(160, 80));
- const size_t kEncodedSizeThreshold = 16;
+ const size_t kEncodedSizeThreshold = 14;
{
base::RunLoop run_loop;
base::Closure quit_closure = run_loop.QuitClosure();
@@ -229,7 +234,7 @@ TEST_P(MediaRecorderHandlerTest, EncodeVideoFrames) {
// the last time it is called it has the encoded data.
EXPECT_CALL(*this, writeData(_, Lt(kEncodedSizeThreshold), _))
.Times(AtLeast(1));
- EXPECT_CALL(*this, writeData(_, Gt(kEncodedSizeThreshold), _))
+ EXPECT_CALL(*this, writeData(_, Ge(kEncodedSizeThreshold), _))
.Times(1)
.WillOnce(RunClosure(quit_closure));
@@ -245,7 +250,7 @@ TEST_P(MediaRecorderHandlerTest, EncodeVideoFrames) {
// the WebM frame header, and then is pinged with the encoded data.
EXPECT_CALL(*this, writeData(_, Lt(kEncodedSizeThreshold), _))
.Times(AtLeast(1));
- EXPECT_CALL(*this, writeData(_, Gt(kEncodedSizeThreshold), _))
+ EXPECT_CALL(*this, writeData(_, Ge(kEncodedSizeThreshold), _))
.Times(1)
.WillOnce(RunClosure(quit_closure));
« no previous file with comments | « content/renderer/media/media_recorder_handler.cc ('k') | content/renderer/media/video_track_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698