OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/media/webrtc/webrtc_browsertest_base.h" | 5 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 content::WebContents* from_tab, | 397 content::WebContents* from_tab, |
398 content::WebContents* to_tab) const { | 398 content::WebContents* to_tab) const { |
399 std::string ice_candidates = | 399 std::string ice_candidates = |
400 ExecuteJavascript("getAllIceCandidates()", from_tab); | 400 ExecuteJavascript("getAllIceCandidates()", from_tab); |
401 | 401 |
402 EXPECT_EQ("ok-received-candidates", ExecuteJavascript( | 402 EXPECT_EQ("ok-received-candidates", ExecuteJavascript( |
403 base::StringPrintf("receiveIceCandidates('%s')", ice_candidates.c_str()), | 403 base::StringPrintf("receiveIceCandidates('%s')", ice_candidates.c_str()), |
404 to_tab)); | 404 to_tab)); |
405 } | 405 } |
406 | 406 |
| 407 void WebRtcTestBase::CreateDataChannel(content::WebContents* tab, |
| 408 const std::string& label) { |
| 409 EXPECT_EQ("ok-created", |
| 410 ExecuteJavascript("createDataChannel('" + label + "')", tab)); |
| 411 } |
| 412 |
407 void WebRtcTestBase::NegotiateCall(content::WebContents* from_tab, | 413 void WebRtcTestBase::NegotiateCall(content::WebContents* from_tab, |
408 content::WebContents* to_tab) const { | 414 content::WebContents* to_tab) const { |
409 std::string local_offer = CreateLocalOffer(from_tab); | 415 std::string local_offer = CreateLocalOffer(from_tab); |
410 std::string answer = CreateAnswer(local_offer, to_tab); | 416 std::string answer = CreateAnswer(local_offer, to_tab); |
411 ReceiveAnswer(answer, from_tab); | 417 ReceiveAnswer(answer, from_tab); |
412 | 418 |
413 // Send all ICE candidates (wait for gathering to finish if necessary). | 419 // Send all ICE candidates (wait for gathering to finish if necessary). |
414 GatherAndSendIceCandidates(to_tab, from_tab); | 420 GatherAndSendIceCandidates(to_tab, from_tab); |
415 GatherAndSendIceCandidates(from_tab, to_tab); | 421 GatherAndSendIceCandidates(from_tab, to_tab); |
416 } | 422 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 void WebRtcTestBase::SetDefaultVideoCodec( | 503 void WebRtcTestBase::SetDefaultVideoCodec( |
498 content::WebContents* tab, | 504 content::WebContents* tab, |
499 const std::string& video_codec) const { | 505 const std::string& video_codec) const { |
500 EXPECT_EQ("ok-forced", | 506 EXPECT_EQ("ok-forced", |
501 ExecuteJavascript("forceVideoCodec('" + video_codec + "')", tab)); | 507 ExecuteJavascript("forceVideoCodec('" + video_codec + "')", tab)); |
502 } | 508 } |
503 | 509 |
504 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { | 510 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { |
505 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); | 511 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); |
506 } | 512 } |
OLD | NEW |