Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1623)

Unified Diff: chrome/browser/media/webrtc_browsertest_base.cc

Issue 1962673002: WebRtcBrowserTest prep-CL for IndexedDB cloning of RTCCertificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.h ('k') | chrome/test/data/webrtc/indexeddb.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc_browsertest_base.cc
diff --git a/chrome/browser/media/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc_browsertest_base.cc
index 06e452afa69c5f357d392a494b0e4b38c026087a..2bf4a0fabe268c390fb84213224116e22d5682e1 100644
--- a/chrome/browser/media/webrtc_browsertest_base.cc
+++ b/chrome/browser/media/webrtc_browsertest_base.cc
@@ -306,18 +306,32 @@ std::string WebRtcTestBase::ExecuteJavascript(
void WebRtcTestBase::SetupPeerconnectionWithLocalStream(
content::WebContents* tab,
- std::string certificate_keygen_algorithm) const {
+ const std::string& certificate_keygen_algorithm) const {
SetupPeerconnectionWithoutLocalStream(tab, certificate_keygen_algorithm);
EXPECT_EQ("ok-added", ExecuteJavascript("addLocalStream()", tab));
}
void WebRtcTestBase::SetupPeerconnectionWithoutLocalStream(
content::WebContents* tab,
- std::string certificate_keygen_algorithm) const {
+ const std::string& certificate_keygen_algorithm) const {
std::string javascript = base::StringPrintf(
"preparePeerConnection(%s)", certificate_keygen_algorithm.c_str());
- EXPECT_EQ("ok-peerconnection-created",
- ExecuteJavascript(javascript, tab));
+ EXPECT_EQ("ok-peerconnection-created", ExecuteJavascript(javascript, tab));
+}
+
+void WebRtcTestBase::SetupPeerconnectionWithCertificateAndLocalStream(
+ content::WebContents* tab,
+ const std::string& certificate) const {
+ SetupPeerconnectionWithCertificateWithoutLocalStream(tab, certificate);
+ EXPECT_EQ("ok-added", ExecuteJavascript("addLocalStream()", tab));
+}
+
+void WebRtcTestBase::SetupPeerconnectionWithCertificateWithoutLocalStream(
+ content::WebContents* tab,
+ const std::string& certificate) const {
+ std::string javascript = base::StringPrintf(
+ "preparePeerConnectionWithCertificate(%s)", certificate.c_str());
+ EXPECT_EQ("ok-peerconnection-created", ExecuteJavascript(javascript, tab));
}
std::string WebRtcTestBase::CreateLocalOffer(
@@ -451,3 +465,30 @@ bool WebRtcTestBase::OnWin8() const {
return false;
#endif
}
+
+void WebRtcTestBase::OpenDatabase(content::WebContents* tab) const {
+ std::string response = ExecuteJavascript("openDatabase()", tab);
+ EXPECT_EQ("ok-database-opened", response) << "Failed to open database: "
+ << response;
+}
+
+void WebRtcTestBase::CloseDatabase(content::WebContents* tab) const {
+ std::string response = ExecuteJavascript("closeDatabase()", tab);
+ EXPECT_EQ("ok-database-closed", response) << "Failed to close database: "
+ << response;
+}
+
+void WebRtcTestBase::DeleteDatabase(content::WebContents* tab) const {
+ std::string response = ExecuteJavascript("deleteDatabase()", tab);
+ EXPECT_EQ("ok-database-deleted", response) << "Failed to delete database: "
+ << response;
+}
+
+void WebRtcTestBase::GenerateAndCloneCertificate(
+ content::WebContents* tab, const std::string& keygen_algorithm) const {
+ std::string javascript = base::StringPrintf(
+ "generateAndCloneCertificate(%s)", keygen_algorithm.c_str());
+ std::string response = ExecuteJavascript(javascript, tab);
+ EXPECT_EQ("ok-generated-and-cloned", response) << "Failed to generate and "
+ "clone certificate: " << response;
+}
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.h ('k') | chrome/test/data/webrtc/indexeddb.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698