| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 std::string WebRtcTestBase::GetStreamSize( | 451 std::string WebRtcTestBase::GetStreamSize( |
| 452 content::WebContents* tab_contents, | 452 content::WebContents* tab_contents, |
| 453 const std::string& video_element) const { | 453 const std::string& video_element) const { |
| 454 std::string javascript = | 454 std::string javascript = |
| 455 base::StringPrintf("getStreamSize('%s')", video_element.c_str()); | 455 base::StringPrintf("getStreamSize('%s')", video_element.c_str()); |
| 456 std::string result = ExecuteJavascript(javascript, tab_contents); | 456 std::string result = ExecuteJavascript(javascript, tab_contents); |
| 457 EXPECT_TRUE(base::StartsWith(result, "ok-", base::CompareCase::SENSITIVE)); | 457 EXPECT_TRUE(base::StartsWith(result, "ok-", base::CompareCase::SENSITIVE)); |
| 458 return result.substr(3); | 458 return result.substr(3); |
| 459 } | 459 } |
| 460 | 460 |
| 461 bool WebRtcTestBase::OnWin7() const { |
| 462 #if defined(OS_WIN) |
| 463 return base::win::GetVersion() == base::win::VERSION_WIN7; |
| 464 #else |
| 465 return false; |
| 466 #endif |
| 467 } |
| 468 |
| 461 bool WebRtcTestBase::OnWin8() const { | 469 bool WebRtcTestBase::OnWin8() const { |
| 462 #if defined(OS_WIN) | 470 #if defined(OS_WIN) |
| 463 return base::win::GetVersion() > base::win::VERSION_WIN7; | 471 return base::win::GetVersion() > base::win::VERSION_WIN7; |
| 464 #else | 472 #else |
| 465 return false; | 473 return false; |
| 466 #endif | 474 #endif |
| 467 } | 475 } |
| 468 | 476 |
| 469 void WebRtcTestBase::OpenDatabase(content::WebContents* tab) const { | 477 void WebRtcTestBase::OpenDatabase(content::WebContents* tab) const { |
| 470 EXPECT_EQ("ok-database-opened", ExecuteJavascript("openDatabase()", tab)); | 478 EXPECT_EQ("ok-database-opened", ExecuteJavascript("openDatabase()", tab)); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 void WebRtcTestBase::SetDefaultVideoCodec( | 536 void WebRtcTestBase::SetDefaultVideoCodec( |
| 529 content::WebContents* tab, | 537 content::WebContents* tab, |
| 530 const std::string& video_codec) const { | 538 const std::string& video_codec) const { |
| 531 EXPECT_EQ("ok", ExecuteJavascript( | 539 EXPECT_EQ("ok", ExecuteJavascript( |
| 532 "setDefaultVideoCodec('" + video_codec + "')", tab)); | 540 "setDefaultVideoCodec('" + video_codec + "')", tab)); |
| 533 } | 541 } |
| 534 | 542 |
| 535 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { | 543 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { |
| 536 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); | 544 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); |
| 537 } | 545 } |
| OLD | NEW |