OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "content/child/child_process.h" | 7 #include "content/child/child_process.h" |
8 #include "content/renderer/media/media_recorder_handler.h" | 8 #include "content/renderer/media/media_recorder_handler.h" |
9 #include "content/renderer/media/mock_media_stream_registry.h" | 9 #include "content/renderer/media/mock_media_stream_registry.h" |
10 #include "media/audio/simple_sources.h" | 10 #include "media/audio/simple_sources.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 registry_.Init(kTestStreamUrl); | 71 registry_.Init(kTestStreamUrl); |
72 } | 72 } |
73 | 73 |
74 ~MediaRecorderHandlerTest() { | 74 ~MediaRecorderHandlerTest() { |
75 registry_.reset(); | 75 registry_.reset(); |
76 blink::WebHeap::collectAllGarbageForTesting(); | 76 blink::WebHeap::collectAllGarbageForTesting(); |
77 } | 77 } |
78 | 78 |
79 MOCK_METHOD3(writeData, void(const char*, size_t, bool)); | 79 MOCK_METHOD3(writeData, void(const char*, size_t, bool)); |
80 MOCK_METHOD1(failOutOfMemory, void(const WebString& message)); | 80 MOCK_METHOD1(onError, void(const WebString& message)); |
81 MOCK_METHOD1(failIllegalStreamModification, void(const WebString& message)); | |
82 MOCK_METHOD1(failOtherRecordingError, void(const WebString& message)); | |
83 | 81 |
84 bool recording() const { return media_recorder_handler_->recording_; } | 82 bool recording() const { return media_recorder_handler_->recording_; } |
85 bool hasVideoRecorders() const { | 83 bool hasVideoRecorders() const { |
86 return !media_recorder_handler_->video_recorders_.empty(); | 84 return !media_recorder_handler_->video_recorders_.empty(); |
87 } | 85 } |
88 bool hasAudioRecorders() const { | 86 bool hasAudioRecorders() const { |
89 return !media_recorder_handler_->audio_recorders_.empty(); | 87 return !media_recorder_handler_->audio_recorders_.empty(); |
90 } | 88 } |
91 | 89 |
92 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame) { | 90 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame) { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 319 } |
322 | 320 |
323 media_recorder_handler_->stop(); | 321 media_recorder_handler_->stop(); |
324 | 322 |
325 // Expect a last call on destruction, with size 0 and |lastInSlice| true. | 323 // Expect a last call on destruction, with size 0 and |lastInSlice| true. |
326 EXPECT_CALL(*this, writeData(nullptr, 0, true)).Times(1); | 324 EXPECT_CALL(*this, writeData(nullptr, 0, true)).Times(1); |
327 media_recorder_handler_.reset(); | 325 media_recorder_handler_.reset(); |
328 } | 326 } |
329 | 327 |
330 } // namespace content | 328 } // namespace content |
OLD | NEW |