fune/dom/media/test/marionette/yttest/debug_info.js
Tarek Ziadé 63c5bb98b4 Bug 1541189 - Fix intermittents on stream test - r=whimboo
Tweak the Streaming test to fix intermittents.

Differential Revision: https://phabricator.services.mozilla.com/D26288

--HG--
extra : moz-landing-system : lando
2019-04-08 13:04:20 +00:00

18 lines
702 B
JavaScript

video.mozRequestDebugInfo().then(debugInfo => {
// The parsing won't be necessary once we have bug 1542674
try {
debugInfo = debugInfo.replace(/\t/g, '').split(/\n/g);
var JSONDebugInfo = "{";
for(let g =0; g<debugInfo.length-1; g++){
var pair = debugInfo[g].split(": ");
JSONDebugInfo += '"' + pair[0] + '":"' + pair[1] + '",';
}
JSONDebugInfo = JSONDebugInfo.slice(0,JSONDebugInfo.length-1);
JSONDebugInfo += "}";
result["mozRequestDebugInfo"] = JSON.parse(JSONDebugInfo);
} catch (err) {
console.log(`Error '${err.toString()} in JSON.parse(${debugInfo})`);
result["mozRequestDebugInfo"] = debugInfo;
}
resolve(result);
});