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

Unified Diff: chrome/test/data/webrtc/peerconnection.js

Issue 1036143003: Revert "webrtc: Fixes WebRtcBrowserTest to use DOM attributes correctly." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/peerconnection.js
diff --git a/chrome/test/data/webrtc/peerconnection.js b/chrome/test/data/webrtc/peerconnection.js
index 68ff1ac9f135462202109802fe173dbdc55ae708..00c0306535b757f5f7c578267ea18e382940bd78 100644
--- a/chrome/test/data/webrtc/peerconnection.js
+++ b/chrome/test/data/webrtc/peerconnection.js
@@ -57,7 +57,7 @@ function createLocalOffer(constraints) {
success_('createOffer');
setLocalDescription(peerConnection, localOffer);
- returnToTest('ok-' + stringifyDOMObject_(localOffer));
+ returnToTest('ok-' + JSON.stringify(localOffer));
},
function(error) { failure_('createOffer', error); },
constraints);
@@ -89,7 +89,7 @@ function receiveOfferFromPeer(sessionDescJson, constraints) {
function(answer) {
success_('createAnswer');
setLocalDescription(peerConnection, answer);
- returnToTest('ok-' + stringifyDOMObject_(answer));
+ returnToTest('ok-' + JSON.stringify(answer));
},
function(error) { failure_('createAnswer', error); },
constraints);
@@ -178,7 +178,7 @@ function getAllIceCandidates() {
return;
}
- returnToTest(stringifyDOMObject_(gIceCandidates));
+ returnToTest(JSON.stringify(gIceCandidates));
}
/**
@@ -261,7 +261,7 @@ function success_(method) {
/** @private */
function failure_(method, error) {
- throw failTest(method + '() failed: ' + stringifyDOMObject_(error));
+ throw failTest(method + '() failed: ' + JSON.stringify(error));
}
/** @private */
@@ -296,28 +296,6 @@ function removeStreamCallback_(event) {
}
/**
- * Stringifies a DOM object.
- *
- * This function stringifies not only own properties but also DOM attributes
- * which are on a prototype chain. Note that JSON.stringify only stringifies
- * own properties.
- * @private
- */
-function stringifyDOMObject_(object)
-{
- function deepCopy(src) {
- if (typeof src != "object")
- return src;
- var dst = Array.isArray(src) ? [] : {};
- for (var property in src) {
- dst[property] = deepCopy(src[property]);
- }
- return dst;
- }
- return JSON.stringify(deepCopy(object));
-}
-
-/**
* Parses JSON-encoded session descriptions and ICE candidates.
* @private
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698