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

Unified Diff: LayoutTests/media/encrypted-media/encrypted-media-waiting-for-a-key.html

Issue 634243005: Improve reliability of EME tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update comments Created 6 years, 2 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 | « LayoutTests/media/encrypted-media/encrypted-media-playback-setmediakeys-before-src.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/encrypted-media/encrypted-media-waiting-for-a-key.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-waiting-for-a-key.html b/LayoutTests/media/encrypted-media/encrypted-media-waiting-for-a-key.html
index a94f4a4e350aa8c3f05540e9da00b01cb165b239..3c7b096db60c63bd0ea8602762739b146656644a 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-waiting-for-a-key.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-waiting-for-a-key.html
@@ -14,8 +14,8 @@
{
var video = document.getElementById('testVideo');
var mediaKeySession = null;
- var sessionCreated = false;
var sessionReadyReceived = false;
+ var encryptedEventCount = 0;
var keyId = null;
var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
@@ -27,11 +27,14 @@
assert_true(event instanceof window.MediaEncryptedEvent);
assert_equals(event.type, 'encrypted');
- // The same decryption key is shared by all streams so only
- // create a shared session once.
- if (sessionCreated)
+ // The same decryption key is used by both the audio and
+ // the video streams so only create a session once. To
+ // avoid issues when comparing the expected.txt file
+ // (which logs the events in the order they occur), create
+ // the session on the second event. This also ensures we
+ // see both events.
+ if (++encryptedEventCount != 2)
return;
- sessionCreated = true;
mediaKeySession = video.mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
« no previous file with comments | « LayoutTests/media/encrypted-media/encrypted-media-playback-setmediakeys-before-src.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698