1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/renderer/media/mock_webrtc_logging_message_filter.h"
7 #include "base/logging.h"
8 #include "base/message_loop/message_loop_proxy.h"
10 MockWebRtcLoggingMessageFilter::MockWebRtcLoggingMessageFilter(
11 const scoped_refptr<base::MessageLoopProxy>& io_message_loop)
12 : WebRtcLoggingMessageFilter(io_message_loop),
13 logging_stopped_(false) {
16 MockWebRtcLoggingMessageFilter::~MockWebRtcLoggingMessageFilter() {
19 void MockWebRtcLoggingMessageFilter::AddLogMessages(
20 const std::vector<WebRtcLoggingMessageData>& messages) {
21 CHECK(io_message_loop_->BelongsToCurrentThread());
22 for (size_t i = 0; i < messages.size(); ++i)
23 log_buffer_ += messages[i].message + "\n";
26 void MockWebRtcLoggingMessageFilter::LoggingStopped() {
27 CHECK(io_message_loop_->BelongsToCurrentThread());
28 logging_stopped_ = true;