Commit 2af6397c authored by jrummell@chromium.org's avatar jrummell@chromium.org

Add logging to encrypted-media-encrypted-event-different-origin.html

Test is still timing out, but since the test doesn't log anything, it's
hard to tell if the test actually starts running. Adding some logging
so that on failures we can tell how far the test gets.

BUG=522646
TEST=test passes

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

git-svn-id: svn://svn.chromium.org/blink/trunk@201029 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7ff66427
......@@ -14,8 +14,18 @@
var video = document.getElementById('testVideo');
var encryptedEventCount = 0;
function logMessage(msg) {
var date = new Date();
var hours = ('0' + date.getHours()).slice(-2);
var minutes = ('0' + date.getMinutes()).slice(-2);
var secs = ('0' + date.getSeconds()).slice(-2);
var milliSecs = ('00' + date.getMilliseconds()).slice(-3);
console.log(hours + ':' + minutes + ':' + secs + '.' + milliSecs + ': ' + msg);
};
function onEncrypted(event)
{
logMessage('onEncrypted');
assert_equals(event.target, video);
assert_true(event instanceof window.MediaEncryptedEvent);
assert_equals(event.type, 'encrypted');
......@@ -27,10 +37,13 @@
// Both the audio and the video tracks have initData,
// so finish once both events are received.
if (++encryptedEventCount == 2)
if (++encryptedEventCount == 2) {
logMessage('done');
test.done();
}
}
logMessage('starting');
navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) {
return access.createMediaKeys();
}).then(function(mediaKeys) {
......@@ -39,6 +52,7 @@
}).then(function(result) {
// Verify that the current origin is different than what
// we use for the content.
logMessage('setting src');
assert_equals(document.origin, 'http://127.0.0.1:8000');
video.src = 'http://127.0.0.1:8080/media/encrypted-media/test-encrypted.webm';
video.play();
......
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