| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 #endif | 444 #endif |
| 445 } | 445 } |
| 446 | 446 |
| 447 bool WebRtcTestBase::OnWin8() const { | 447 bool WebRtcTestBase::OnWin8() const { |
| 448 #if defined(OS_WIN) | 448 #if defined(OS_WIN) |
| 449 return base::win::GetVersion() > base::win::VERSION_WIN7; | 449 return base::win::GetVersion() > base::win::VERSION_WIN7; |
| 450 #else | 450 #else |
| 451 return false; | 451 return false; |
| 452 #endif | 452 #endif |
| 453 } | 453 } |
| 454 |
| 455 void WebRtcTestBase::OpenDatabase(content::WebContents* tab) const { |
| 456 std::string response = ExecuteJavascript("openDatabase()", tab); |
| 457 EXPECT_EQ("ok-", response.substr(0, 3)) << "Failed to open database: " |
| 458 << response; |
| 459 } |
| 460 |
| 461 void WebRtcTestBase::CloseDatabase(content::WebContents* tab) const { |
| 462 std::string response = ExecuteJavascript("closeDatabase()", tab); |
| 463 EXPECT_EQ("ok-", response.substr(0, 3)) << "Failed to close database: " |
| 464 << response; |
| 465 } |
| 466 |
| 467 void WebRtcTestBase::DeleteDatabase(content::WebContents* tab) const { |
| 468 std::string response = ExecuteJavascript("deleteDatabase()", tab); |
| 469 EXPECT_EQ("ok-", response.substr(0, 3)) << "Failed to delete database: " |
| 470 << response; |
| 471 } |
| 472 |
| 473 void WebRtcTestBase::GenerateAndCloneCertificate( |
| 474 content::WebContents* tab, const std::string& keygen_algorithm) const { |
| 475 std::string javascript = base::StringPrintf( |
| 476 "generateAndCloneCertificate(%s)", keygen_algorithm.c_str()); |
| 477 std::string response = ExecuteJavascript(javascript, tab); |
| 478 EXPECT_EQ("ok-", response.substr(0, 3)) << "Failed to generate and clone " |
| 479 "certificate: " << response; |
| 480 } |
| OLD | NEW |