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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 453 |
454 bool WebRtcTestBase::OnWin8() const { | 454 bool WebRtcTestBase::OnWin8() const { |
455 #if defined(OS_WIN) | 455 #if defined(OS_WIN) |
456 return base::win::GetVersion() > base::win::VERSION_WIN7; | 456 return base::win::GetVersion() > base::win::VERSION_WIN7; |
457 #else | 457 #else |
458 return false; | 458 return false; |
459 #endif | 459 #endif |
460 } | 460 } |
461 | 461 |
462 void WebRtcTestBase::OpenDatabase(content::WebContents* tab) const { | 462 void WebRtcTestBase::OpenDatabase(content::WebContents* tab) const { |
463 std::string response = ExecuteJavascript("openDatabase()", tab); | 463 EXPECT_EQ("ok-database-opened", ExecuteJavascript("openDatabase()", tab)); |
464 EXPECT_EQ("ok-database-opened", response) << "Failed to open database: " | |
465 << response; | |
466 } | 464 } |
467 | 465 |
468 void WebRtcTestBase::CloseDatabase(content::WebContents* tab) const { | 466 void WebRtcTestBase::CloseDatabase(content::WebContents* tab) const { |
469 std::string response = ExecuteJavascript("closeDatabase()", tab); | 467 EXPECT_EQ("ok-database-closed", ExecuteJavascript("closeDatabase()", tab)); |
470 EXPECT_EQ("ok-database-closed", response) << "Failed to close database: " | |
471 << response; | |
472 } | 468 } |
473 | 469 |
474 void WebRtcTestBase::DeleteDatabase(content::WebContents* tab) const { | 470 void WebRtcTestBase::DeleteDatabase(content::WebContents* tab) const { |
475 std::string response = ExecuteJavascript("deleteDatabase()", tab); | 471 EXPECT_EQ("ok-database-deleted", ExecuteJavascript("deleteDatabase()", tab)); |
476 EXPECT_EQ("ok-database-deleted", response) << "Failed to delete database: " | |
477 << response; | |
478 } | 472 } |
479 | 473 |
480 void WebRtcTestBase::GenerateAndCloneCertificate( | 474 void WebRtcTestBase::GenerateAndCloneCertificate( |
481 content::WebContents* tab, const std::string& keygen_algorithm) const { | 475 content::WebContents* tab, const std::string& keygen_algorithm) const { |
482 std::string javascript = base::StringPrintf( | 476 std::string javascript = base::StringPrintf( |
483 "generateAndCloneCertificate(%s)", keygen_algorithm.c_str()); | 477 "generateAndCloneCertificate(%s)", keygen_algorithm.c_str()); |
484 std::string response = ExecuteJavascript(javascript, tab); | 478 EXPECT_EQ("ok-generated-and-cloned", ExecuteJavascript(javascript, tab)); |
485 EXPECT_EQ("ok-generated-and-cloned", response) << "Failed to generate and " | |
486 "clone certificate: " << response; | |
487 } | 479 } |
| 480 |
| 481 void WebRtcTestBase::VerifyStatsGenerated(content::WebContents* tab) const { |
| 482 EXPECT_EQ("ok-got-stats", ExecuteJavascript("verifyStatsGenerated()", tab)); |
| 483 } |
OLD | NEW |