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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html

Issue 2406073002: EME: Implement Session Closed algorithm (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Verify MediaKeySession.keyStatuses</title> 4 <title>Verify MediaKeySession.keyStatuses</title>
5 <script src="encrypted-media-utils.js"></script> 5 <script src="encrypted-media-utils.js"></script>
6 <script src="../../resources/testharness.js"></script> 6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script> 7 <script src="../../resources/testharnessreport.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 checkKeyStatusFor2Keys(); 135 checkKeyStatusFor2Keys();
136 136
137 mediaKeySession.close().catch(function(error) { 137 mediaKeySession.close().catch(function(error) {
138 forceTestFailureFromPromise(test, error); 138 forceTestFailureFromPromise(test, error);
139 }); 139 });
140 closed = true; 140 closed = true;
141 } 141 }
142 else 142 else
143 { 143 {
144 // The second keystatuseschange (caused by close()) 144 // The second keystatuseschange (caused by close())
145 // should not have any keys. 145 // should not have any keys, and the expiration time
146 // should be NaN.
146 assert_equals(mediaKeySession.keyStatuses.size, 0); 147 assert_equals(mediaKeySession.keyStatuses.size, 0);
148 assert_true(isNaN(mediaKeySession.expiration));
ddorwin 2016/10/11 01:41:07 We might need to update the spec test.
jrummell 2016/10/11 18:47:35 I wanted to make sure that we verified that this w
147 test.done(); 149 test.done();
148 } 150 }
149 } 151 }
150 152
151 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp leConfiguration()).then(function(access) { 153 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp leConfiguration()).then(function(access) {
152 initDataType = access.getConfiguration().initDataTypes[0]; 154 initDataType = access.getConfiguration().initDataTypes[0];
153 initData = getInitData(initDataType); 155 initData = getInitData(initDataType);
154 return access.createMediaKeys(); 156 return access.createMediaKeys();
155 }).then(function(mediaKeys) { 157 }).then(function(mediaKeys) {
156 mediaKeySession = mediaKeys.createSession(); 158 mediaKeySession = mediaKeys.createSession();
157 159
158 // There should be no keys defined yet. 160 // There should be no keys defined yet.
159 assert_equals(mediaKeySession.keyStatuses.size, 0); 161 assert_equals(mediaKeySession.keyStatuses.size, 0);
160 162
161 waitForEventAndRunStep('message', mediaKeySession, processMe ssage, test); 163 waitForEventAndRunStep('message', mediaKeySession, processMe ssage, test);
162 return mediaKeySession.generateRequest(initDataType, initDat a); 164 return mediaKeySession.generateRequest(initDataType, initDat a);
163 }).catch(function(error) { 165 }).catch(function(error) {
164 forceTestFailureFromPromise(test, error); 166 forceTestFailureFromPromise(test, error);
165 }); 167 });
166 }, 'Verify MediaKeySession.keyStatuses.'); 168 }, 'Verify MediaKeySession.keyStatuses.');
167 </script> 169 </script>
168 </body> 170 </body>
169 </html> 171 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698