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

Unified Diff: media/capture/webm_muxer_unittest.cc

Issue 1351473006: WebmMuxer-MediaRecorderHandler: thread hopping and data ownership (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: StringPiece passed by value Created 5 years, 3 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 | « media/capture/webm_muxer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/webm_muxer_unittest.cc
diff --git a/media/capture/webm_muxer_unittest.cc b/media/capture/webm_muxer_unittest.cc
index bde9b4fb49a6d398240d17bb34f220f09bd84b48..7e162fa0a676b0422cb17b88956486dd6de22e7c 100644
--- a/media/capture/webm_muxer_unittest.cc
+++ b/media/capture/webm_muxer_unittest.cc
@@ -19,14 +19,7 @@ using ::testing::WithArgs;
namespace media {
-// Dummy interface class to be able to MOCK its only function below.
-class EventHandlerInterface {
- public:
- virtual void WriteCallback(const base::StringPiece& encoded_data) = 0;
- virtual ~EventHandlerInterface() {}
-};
-
-class WebmMuxerTest : public testing::Test, public EventHandlerInterface {
+class WebmMuxerTest : public testing::Test {
public:
WebmMuxerTest()
: webm_muxer_(base::Bind(&WebmMuxerTest::WriteCallback,
@@ -39,7 +32,7 @@ class WebmMuxerTest : public testing::Test, public EventHandlerInterface {
EXPECT_FALSE(webm_muxer_.Seekable());
}
- MOCK_METHOD1(WriteCallback, void(const base::StringPiece&));
+ MOCK_METHOD1(WriteCallback, void(base::StringPiece));
void SaveEncodedDataLen(const base::StringPiece& encoded_data) {
last_encoded_length_ = encoded_data.size();
@@ -84,14 +77,14 @@ TEST_F(WebmMuxerTest, OnEncodedVideoTwoFrames) {
const gfx::Size frame_size(160, 80);
const scoped_refptr<VideoFrame> video_frame =
VideoFrame::CreateBlackFrame(frame_size);
- const base::StringPiece encoded_data("abcdefghijklmnopqrstuvwxyz");
+ const std::string encoded_data("abcdefghijklmnopqrstuvwxyz");
EXPECT_CALL(*this, WriteCallback(_))
.Times(AtLeast(1))
.WillRepeatedly(WithArgs<0>(
Invoke(this, &WebmMuxerTest::SaveEncodedDataLen)));
webm_muxer_.OnEncodedVideo(video_frame,
- encoded_data,
+ make_scoped_ptr(new std::string(encoded_data)),
base::TimeTicks::Now(),
false /* keyframe */);
@@ -108,7 +101,7 @@ TEST_F(WebmMuxerTest, OnEncodedVideoTwoFrames) {
.WillRepeatedly(WithArgs<0>(
Invoke(this, &WebmMuxerTest::SaveEncodedDataLen)));
webm_muxer_.OnEncodedVideo(video_frame,
- encoded_data,
+ make_scoped_ptr(new std::string(encoded_data)),
base::TimeTicks::Now(),
false /* keyframe */);
« no previous file with comments | « media/capture/webm_muxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698