Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / encrypted-media / encrypted-media-clearkey-update-non-ascii-input.html
blob00e4f944c6e9397d3b162a8ec3e1d5a91da7066f
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test Clear Key handling of non-ASCII responses for update().</title>
5 <script src="encrypted-media-utils.js"></script>
6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 </head>
9 <body>
10 <div id="log"></div>
11 <script>
12 // This test passes |response| to update() as a JSON Web Key Set.
13 // CDMs other than Clear Key won't expect |response| in this format.
15 async_test(function(test)
17 var initDataType;
18 var mediaKeySession;
20 function processMessage(event)
22 // |jwkSet| includes some non-ASCII characters.
23 var jwkSet = '{"keys":[{'
24 + '"kty":"oct\uDC00\uD800",'
25 + '"k":"MDEyMzQ1Njc4OTAxMjM0NQ",'
26 + '"kid":"MDEyMzQ1Njc4OTAxMjM0NQ"'
27 + '\xff\xfe}]';
28 mediaKeySession.update(stringToUint8Array(jwkSet)).then(function() {
29 forceTestFailureFromPromise(test, 'Error: update() succeeded');
30 }, function(error) {
31 assert_equals(error.name, 'InvalidAccessError');
32 test.done();
33 });
36 getSupportedInitDataType().then(function(type) {
37 initDataType = type;
38 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]);
39 }).then(function(access) {
40 return access.createMediaKeys();
41 }).then(function(mediaKeys) {
42 mediaKeySession = mediaKeys.createSession();
43 waitForEventAndRunStep('message', mediaKeySession, processMessage, test);
44 return mediaKeySession.generateRequest(initDataType, getInitData(initDataType));
45 });
46 }, 'Clear Key update() with non-ASCII response.');
47 </script>
48 </body>
49 </html>