Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / media / encrypted-media / encrypted-media-lifetime-mediakeysession-release.html
index 8cb042f..39d1605 100644 (file)
                 }
 
                 // Create 2 sessions.
-                MediaKeys.create('org.w3.clearkey').then(function(result) {
+                navigator.requestMediaKeySystemAccess('org.w3.clearkey').then(function(access) {
+                    return access.createMediaKeys();
+                }).then(function(result) {
                     mediaKeys = result;
 
                     // Verify MediaKeys are not an ActiveDOMObject.
                     assert_equals(numActiveDOMObjectsCreated(), 0, 'MediaKeys.create()');
 
-                    return mediaKeys.createSession(initDataType, initData);
-                }).then(function(result) {
-                    mediaKeySession1 = result;
+                    mediaKeySession1 = mediaKeys.createSession();
+                    return mediaKeySession1.generateRequest(initDataType, initData);
+                }).then(function() {
                     // Should be 1 MediaKeySession.
                     assert_equals(numActiveDOMObjectsCreated(), 1, 'mediaKeys.createSession(1)');
-                    return mediaKeys.createSession(initDataType, initData);
-                }).then(function(result) {
-                    mediaKeySession2 = result;
+                    mediaKeySession2 = mediaKeys.createSession();
+                    return mediaKeySession2.generateRequest(initDataType, initData);
+                }).then(function() {
                     // Should be 2 MediaKeySessions.
                     assert_equals(numActiveDOMObjectsCreated(), 2, 'mediaKeys.createSession(2)');
 
-                    // Release the sessions. Once completed, only the JS
+                    // Close the sessions. Once completed, only the JS
                     // reference to them keeps them around.
-                    return mediaKeySession1.release();
+                    return mediaKeySession1.close();
                 }).then(function(result) {
-                    return mediaKeySession2.release();
+                    return mediaKeySession2.close();
                 }).then(function(result) {
                     // Since both sessions have been closed, dropping the
                     // reference to them from JS will result in the session