| <title>Shadowing then()</title> |
| This test verifies that the implementation of navigator.webkitGetUserMedia does not use public promise APIs. |
| testRunner.waitUntilDone(); |
| function endTest(testStatus) { |
| document.getElementById("output").textContent = testStatus; |
| // Shadow Promise.prototype.then |
| Promise.prototype.then = (function () { |
| const realThen = Promise.prototype.then; |
| endTest("FAIL: Executed shadowed, public .then()"); |
| function gotUserMedia(mediaStream) { |
| endTest("FAIL: Got user media"); |
| function userMediaError(error) { |
| var options = { audio: false, video: false }; |
| navigator.webkitGetUserMedia(options, gotUserMedia, userMediaError); |