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_browsertest_base.h" | 5 #include "chrome/browser/media/webrtc_browsertest_base.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/media/webrtc_browsertest_common.h" | 10 #include "chrome/browser/media/webrtc_browsertest_common.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 base::StringPrintf("receiveOfferFromPeer('%s', {})", local_offer.c_str()); | 326 base::StringPrintf("receiveOfferFromPeer('%s', {})", local_offer.c_str()); |
327 std::string response = ExecuteJavascript(javascript, to_tab); | 327 std::string response = ExecuteJavascript(javascript, to_tab); |
328 EXPECT_EQ("ok-", response.substr(0, 3)) | 328 EXPECT_EQ("ok-", response.substr(0, 3)) |
329 << "Receiving peer failed to receive offer and create answer: " | 329 << "Receiving peer failed to receive offer and create answer: " |
330 << response; | 330 << response; |
331 | 331 |
332 std::string answer = response.substr(3); | 332 std::string answer = response.substr(3); |
333 return answer; | 333 return answer; |
334 } | 334 } |
335 | 335 |
336 void WebRtcTestBase::ReceiveAnswer(std::string answer, | 336 void WebRtcTestBase::ReceiveAnswer(const std::string& answer, |
337 content::WebContents* from_tab) const { | 337 content::WebContents* from_tab) const { |
338 ASSERT_EQ( | 338 ASSERT_EQ( |
339 "ok-accepted-answer", | 339 "ok-accepted-answer", |
340 ExecuteJavascript( | 340 ExecuteJavascript( |
341 base::StringPrintf("receiveAnswerFromPeer('%s')", answer.c_str()), | 341 base::StringPrintf("receiveAnswerFromPeer('%s')", answer.c_str()), |
342 from_tab)); | 342 from_tab)); |
343 } | 343 } |
344 | 344 |
345 void WebRtcTestBase::GatherAndSendIceCandidates( | 345 void WebRtcTestBase::GatherAndSendIceCandidates( |
346 content::WebContents* from_tab, | 346 content::WebContents* from_tab, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 #endif | 413 #endif |
414 } | 414 } |
415 | 415 |
416 bool WebRtcTestBase::OnWin8() const { | 416 bool WebRtcTestBase::OnWin8() const { |
417 #if defined(OS_WIN) | 417 #if defined(OS_WIN) |
418 return base::win::GetVersion() > base::win::VERSION_WIN7; | 418 return base::win::GetVersion() > base::win::VERSION_WIN7; |
419 #else | 419 #else |
420 return false; | 420 return false; |
421 #endif | 421 #endif |
422 } | 422 } |
OLD | NEW |