Commit bf0d1a26 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Move mock_web_rtc_peer_connection_handler_client.cc|h to Blink

These files need to be moved to Blink as part of the phase 8 on
the design document [1].

[1] https://docs.google.com/document/d/1AJKVA5U4nDkyDB9p4ROrggWXadCxyy-grKaE9KS5vOU/edit?ts=5d5c1757

Since they can get moved independently, this CL does so, so reviewing
the main CL is eased.

BUG=787254
R=guidou@chromium.org, haraken@chromium.org

Change-Id: I23f65a6187f2eb1402170ebf182552d054ad3fdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1839091
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705097}
parent 49b7f262
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "content/renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.h"
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h" #include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h" #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h" #include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_web_rtc_peer_connection_handler_client.h"
namespace content { namespace content {
...@@ -67,7 +67,7 @@ class PeerConnectionDependencyFactoryTest : public ::testing::Test { ...@@ -67,7 +67,7 @@ class PeerConnectionDependencyFactoryTest : public ::testing::Test {
}; };
TEST_F(PeerConnectionDependencyFactoryTest, CreateRTCPeerConnectionHandler) { TEST_F(PeerConnectionDependencyFactoryTest, CreateRTCPeerConnectionHandler) {
MockWebRTCPeerConnectionHandlerClient client_jsep; blink::MockWebRTCPeerConnectionHandlerClient client_jsep;
std::unique_ptr<blink::WebRTCPeerConnectionHandler> pc_handler( std::unique_ptr<blink::WebRTCPeerConnectionHandler> pc_handler(
dependency_factory_->CreateRTCPeerConnectionHandler( dependency_factory_->CreateRTCPeerConnectionHandler(
&client_jsep, &client_jsep,
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "content/common/media/peer_connection_tracker.mojom.h" #include "content/common/media/peer_connection_tracker.mojom.h"
#include "content/common/media/peer_connection_tracker_messages.h" #include "content/common/media/peer_connection_tracker_messages.h"
#include "content/public/test/mock_render_thread.h" #include "content/public/test/mock_render_thread.h"
#include "content/renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.h"
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h" #include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
#include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_macros.h"
#include "mojo/public/cpp/bindings/associated_binding.h" #include "mojo/public/cpp/bindings/associated_binding.h"
...@@ -22,6 +21,7 @@ ...@@ -22,6 +21,7 @@
#include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h" #include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h"
#include "third_party/blink/public/web/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h" #include "third_party/blink/public/web/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h" #include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_web_rtc_peer_connection_handler_client.h"
using ::testing::_; using ::testing::_;
...@@ -132,7 +132,7 @@ class MockPeerConnectionHandler : public RTCPeerConnectionHandler { ...@@ -132,7 +132,7 @@ class MockPeerConnectionHandler : public RTCPeerConnectionHandler {
private: private:
blink::MockPeerConnectionDependencyFactory dependency_factory_; blink::MockPeerConnectionDependencyFactory dependency_factory_;
MockWebRTCPeerConnectionHandlerClient client_; blink::MockWebRTCPeerConnectionHandlerClient client_;
}; };
class PeerConnectionTrackerTest : public ::testing::Test { class PeerConnectionTrackerTest : public ::testing::Test {
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "base/values.h" #include "base/values.h"
#include "content/child/child_process.h" #include "content/child/child_process.h"
#include "content/renderer/media/audio/mock_audio_device_factory.h" #include "content/renderer/media/audio/mock_audio_device_factory.h"
#include "content/renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.h"
#include "content/renderer/media/webrtc/peer_connection_tracker.h" #include "content/renderer/media/webrtc/peer_connection_tracker.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -55,6 +54,7 @@ ...@@ -55,6 +54,7 @@
#include "third_party/blink/public/web/modules/peerconnection/mock_data_channel_impl.h" #include "third_party/blink/public/web/modules/peerconnection/mock_data_channel_impl.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h" #include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_impl.h" #include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_impl.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_web_rtc_peer_connection_handler_client.h"
#include "third_party/blink/public/web/modules/webrtc/webrtc_audio_device_impl.h" #include "third_party/blink/public/web/modules/webrtc/webrtc_audio_device_impl.h"
#include "third_party/blink/public/web/web_heap.h" #include "third_party/blink/public/web/web_heap.h"
#include "third_party/webrtc/api/peer_connection_interface.h" #include "third_party/webrtc/api/peer_connection_interface.h"
...@@ -289,7 +289,8 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { ...@@ -289,7 +289,8 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test {
RTCPeerConnectionHandlerTest() : mock_peer_connection_(nullptr) {} RTCPeerConnectionHandlerTest() : mock_peer_connection_(nullptr) {}
void SetUp() override { void SetUp() override {
mock_client_.reset(new NiceMock<MockWebRTCPeerConnectionHandlerClient>()); mock_client_.reset(
new NiceMock<blink::MockWebRTCPeerConnectionHandlerClient>());
mock_dependency_factory_.reset( mock_dependency_factory_.reset(
new blink::MockPeerConnectionDependencyFactory()); new blink::MockPeerConnectionDependencyFactory());
...@@ -588,7 +589,7 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { ...@@ -588,7 +589,7 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test {
std::unique_ptr<AudioCapturerSourceTestingPlatformSupport> std::unique_ptr<AudioCapturerSourceTestingPlatformSupport>
webrtc_audio_device_platform_support_; webrtc_audio_device_platform_support_;
blink::Platform* platform_original_ = nullptr; blink::Platform* platform_original_ = nullptr;
std::unique_ptr<MockWebRTCPeerConnectionHandlerClient> mock_client_; std::unique_ptr<blink::MockWebRTCPeerConnectionHandlerClient> mock_client_;
std::unique_ptr<blink::MockPeerConnectionDependencyFactory> std::unique_ptr<blink::MockPeerConnectionDependencyFactory>
mock_dependency_factory_; mock_dependency_factory_;
std::unique_ptr<NiceMock<MockPeerConnectionTracker>> mock_tracker_; std::unique_ptr<NiceMock<MockPeerConnectionTracker>> mock_tracker_;
......
...@@ -233,8 +233,6 @@ jumbo_static_library("test_support") { ...@@ -233,8 +233,6 @@ jumbo_static_library("test_support") {
"../public/test/web_contents_binding_set_test_binder.h", "../public/test/web_contents_binding_set_test_binder.h",
"../public/test/web_contents_tester.cc", "../public/test/web_contents_tester.cc",
"../public/test/web_contents_tester.h", "../public/test/web_contents_tester.h",
"../renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.cc",
"../renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.h",
"appcache_test_helper.cc", "appcache_test_helper.cc",
"appcache_test_helper.h", "appcache_test_helper.h",
"barrier_builder.cc", "barrier_builder.cc",
......
...@@ -112,6 +112,7 @@ source_set("test_headers") { ...@@ -112,6 +112,7 @@ source_set("test_headers") {
"web/modules/peerconnection/mock_data_channel_impl.h", "web/modules/peerconnection/mock_data_channel_impl.h",
"web/modules/peerconnection/mock_peer_connection_dependency_factory.h", "web/modules/peerconnection/mock_peer_connection_dependency_factory.h",
"web/modules/peerconnection/mock_peer_connection_impl.h", "web/modules/peerconnection/mock_peer_connection_impl.h",
"web/modules/peerconnection/mock_web_rtc_peer_connection_handler_client.h",
"web/modules/peerconnection/webrtc_stats_report_obtainer.h", "web/modules/peerconnection/webrtc_stats_report_obtainer.h",
] ]
deps = [ deps = [
......
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_WEB_RTC_PEER_CONNECTION_HANDLER_CLIENT_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_PEERCONNECTION_MOCK_WEB_RTC_PEER_CONNECTION_HANDLER_CLIENT_H_
#define CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_WEB_RTC_PEER_CONNECTION_HANDLER_CLIENT_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_PEERCONNECTION_MOCK_WEB_RTC_PEER_CONNECTION_HANDLER_CLIENT_H_
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/platform/web_media_stream.h" #include "third_party/blink/public/platform/web_media_stream.h"
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
#include "third_party/blink/public/platform/web_rtc_rtp_receiver.h" #include "third_party/blink/public/platform/web_rtc_rtp_receiver.h"
#include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h" #include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h"
namespace content { namespace blink {
class MockWebRTCPeerConnectionHandlerClient class MockWebRTCPeerConnectionHandlerClient
: public blink::WebRTCPeerConnectionHandlerClient { : public blink::WebRTCPeerConnectionHandlerClient {
...@@ -87,7 +86,7 @@ class MockWebRTCPeerConnectionHandlerClient ...@@ -87,7 +86,7 @@ class MockWebRTCPeerConnectionHandlerClient
const base::Optional<uint16_t>& candidate_mlineindex() const { const base::Optional<uint16_t>& candidate_mlineindex() const {
return candidate_mline_index_; return candidate_mline_index_;
} }
const std::string& candidate_mid() const { return candidate_mid_ ; } const std::string& candidate_mid() const { return candidate_mid_; }
const blink::WebString& remote_stream_id() const { return remote_stream_id_; } const blink::WebString& remote_stream_id() const { return remote_stream_id_; }
private: private:
...@@ -99,6 +98,6 @@ class MockWebRTCPeerConnectionHandlerClient ...@@ -99,6 +98,6 @@ class MockWebRTCPeerConnectionHandlerClient
DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandlerClient); DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandlerClient);
}; };
} // namespace content } // namespace blink
#endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_WEB_RTC_PEER_CONNECTION_HANDLER_CLIENT_H_ #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_PEERCONNECTION_MOCK_WEB_RTC_PEER_CONNECTION_HANDLER_CLIENT_H_
...@@ -149,6 +149,7 @@ jumbo_source_set("test_support") { ...@@ -149,6 +149,7 @@ jumbo_source_set("test_support") {
"mock_data_channel_impl.cc", "mock_data_channel_impl.cc",
"mock_peer_connection_dependency_factory.cc", "mock_peer_connection_dependency_factory.cc",
"mock_peer_connection_impl.cc", "mock_peer_connection_impl.cc",
"mock_web_rtc_peer_connection_handler_client.cc",
"webrtc_stats_report_obtainer.cc", "webrtc_stats_report_obtainer.cc",
] ]
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.h" #include "third_party/blink/public/web/modules/peerconnection/mock_web_rtc_peer_connection_handler_client.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/blink/public/platform/web_media_stream.h" #include "third_party/blink/public/platform/web_media_stream.h"
#include "third_party/blink/public/platform/web_rtc_rtp_receiver.h" #include "third_party/blink/public/platform/web_rtc_rtp_receiver.h"
#include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_string.h"
using testing::_; using testing::_;
namespace content { namespace blink {
MockWebRTCPeerConnectionHandlerClient::MockWebRTCPeerConnectionHandlerClient() { MockWebRTCPeerConnectionHandlerClient::MockWebRTCPeerConnectionHandlerClient() {
ON_CALL(*this, DidGenerateICECandidate(_)) ON_CALL(*this, DidGenerateICECandidate(_))
...@@ -28,7 +27,7 @@ MockWebRTCPeerConnectionHandlerClient::MockWebRTCPeerConnectionHandlerClient() { ...@@ -28,7 +27,7 @@ MockWebRTCPeerConnectionHandlerClient::MockWebRTCPeerConnectionHandlerClient() {
} }
MockWebRTCPeerConnectionHandlerClient:: MockWebRTCPeerConnectionHandlerClient::
~MockWebRTCPeerConnectionHandlerClient() {} ~MockWebRTCPeerConnectionHandlerClient() {}
void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidateWorker( void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidateWorker(
scoped_refptr<blink::WebRTCICECandidate> candidate) { scoped_refptr<blink::WebRTCICECandidate> candidate) {
...@@ -50,4 +49,4 @@ void MockWebRTCPeerConnectionHandlerClient::didRemoveReceiverWorker( ...@@ -50,4 +49,4 @@ void MockWebRTCPeerConnectionHandlerClient::didRemoveReceiverWorker(
remote_stream_id_ = blink::WebString(); remote_stream_id_ = blink::WebString();
} }
} // namespace content } // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment