Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / renderer / media / mock_webrtc_logging_message_filter.cc
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.
4
5 #include "chrome/renderer/media/mock_webrtc_logging_message_filter.h"
6
7 #include "base/logging.h"
8 #include "base/message_loop/message_loop_proxy.h"
9
10 MockWebRtcLoggingMessageFilter::MockWebRtcLoggingMessageFilter(
11     const scoped_refptr<base::MessageLoopProxy>& io_message_loop)
12     : WebRtcLoggingMessageFilter(io_message_loop),
13       logging_stopped_(false) {
14 }
15
16 MockWebRtcLoggingMessageFilter::~MockWebRtcLoggingMessageFilter() {
17 }
18
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";
24 }
25
26 void MockWebRtcLoggingMessageFilter::LoggingStopped() {
27   CHECK(io_message_loop_->BelongsToCurrentThread());
28   logging_stopped_ = true;
29 }