Commit 95b0f9c8 authored by jrummell's avatar jrummell Committed by Commit bot

Revert of Fix Flaky EncryptedMediaTest (patchset #1 id:1 of...

Revert of Fix Flaky EncryptedMediaTest (patchset #1 id:1 of https://codereview.chromium.org/823743002/)

Reason for revert:
This changes introduces a new problem that is breaking the builds (e.g. http://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20MSan%20Browser%20%281%29/builds/3905).

Original issue's description:
> Fix Flaky EncryptedMediaTest
>
> Tests are flaky as setMediaKeys() was not completing before the
> "encrypted" event was generated. Change delays setting the video
> source until setMediaKeys() completes.
>
> BUG=444683
> TEST=Failing tests run fine locally
>
> Committed: https://crrev.com/37edfbac393c04549884ec15ce612a376a5be6ff
> Cr-Commit-Position: refs/heads/master@{#309568}

TBR=xhwang@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=444683

Review URL: https://codereview.chromium.org/826603002

Cr-Commit-Position: refs/heads/master@{#309587}
parent 4f841af7
......@@ -80,21 +80,19 @@ PlayerUtils.registerEMEEventListeners = function(player) {
try {
Utils.timeLog('Setting video media keys: ' + player.testConfig.keySystem);
if (typeof navigator.requestMediaKeySystemAccess == 'function') {
return navigator.requestMediaKeySystemAccess(player.testConfig.keySystem)
navigator.requestMediaKeySystemAccess(player.testConfig.keySystem)
.then(function(access) { return access.createMediaKeys(); })
.then(function(mediaKeys) { player.video.setMediaKeys(mediaKeys); })
.catch(function(error) { Utils.failTest(error, NOTSUPPORTEDERROR); });
} else {
// TODO(jrummell): Remove this once the blink change for
// requestMediaKeySystemAccess lands.
return MediaKeys.create(player.testConfig.keySystem)
MediaKeys.create(player.testConfig.keySystem)
.then(function(mediaKeys) { player.video.setMediaKeys(mediaKeys); })
.catch(function(error) { Utils.failTest(error, NOTSUPPORTEDERROR); });
}
} catch (e) {
Utils.failTest(e);
// Return a failing promise.
return new Promise(function(resolve, reject) { reject(Error(e)); });
}
};
......@@ -151,9 +149,8 @@ PlayerUtils.setVideoSource = function(player) {
};
PlayerUtils.initEMEPlayer = function(player) {
var promise = this.registerEMEEventListeners(player);
promise.then(function(result) { PlayerUtils.setVideoSource(player); })
.catch(function(error) { Utils.failTest(error, NOTSUPPORTEDERROR); });
this.registerEMEEventListeners(player);
this.setVideoSource(player);
};
PlayerUtils.initPrefixedEMEPlayer = function(player) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment