Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / media / encrypted-media / encrypted-media-unprefixed-after-prefixed.html
index 6ae7911..742ad3e 100644 (file)
                 function loadStarted()
                 {
                     video.webkitGenerateKeyRequest('webkit-org.w3.clearkey');
-                    MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
+                    navigator.requestMediaKeySystemAccess('org.w3.clearkey').then(function(access) {
+                        assert_equals(access.keySystem, 'org.w3.clearkey');
+                        return access.createMediaKeys();
+                    }).then(function(mediaKeys) {
                         assert_not_equals(mediaKeys, null);
-                        assert_equals(mediaKeys.keySystem, 'org.w3.clearkey');
-                        assert_throws('InvalidStateError',
-                                       function () { video.setMediaKeys(mediaKeys); });
-                        test.done();
+                        assert_equals(typeof mediaKeys.createSession, 'function');
+                        video.setMediaKeys(mediaKeys).then(function(result) {
+                            assert_unreached('setMediaKeys should have failed.');
+                        }, function(error) {
+                            assert_equals(error.name, 'InvalidStateError');
+                            assert_not_equals(error.message, '');
+                            test.done();
+                        });
                     }).catch(function(error) {
                         forceTestFailureFromPromise(test, error);
                     });
                 }
 
-                video.src = '../content/test.webm';
+                video.src = '../content/test-encrypted.webm';
                 waitForEventAndRunStep('loadstart', video, loadStarted, test);
             }, 'Call unprefixed EME API after prefixed EME API.');
         </script>