Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / fontface-constructor-error.html
blobb5bdcd38353f7db62aeeacb4c22ef99819c11a58
1 <!doctype html>
2 <script src="../../resources/js-test.js"></script>
3 <script>
4 description('Test FontFace constructor with invalid parameters');
6 window.jsTestIsAsync = true;
8 function step1() {
9 faceWithWrongSrc = new FontFace('test', 'invalid_src');
10 shouldBeEqualToString('faceWithWrongSrc.status', 'error');
11 faceWithWrongSrc.loaded.catch(function(e) {
12 rejectionValue = e;
13 shouldBeEqualToString('rejectionValue.name', 'SyntaxError');
14 step2();
15 });
18 function step2() {
19 faceWithWrongDescriptors = new FontFace('test', 'local(Arial)', {
20 'style': 'x',
21 'weight': 'x',
22 'unicodeRange': 'x',
23 'variant': 'x',
24 'featureSettings': 'x'
25 });
26 shouldBeEqualToString('faceWithWrongDescriptors.status', 'error');
27 shouldBeEqualToString('faceWithWrongDescriptors.style', 'normal');
28 shouldBeEqualToString('faceWithWrongDescriptors.weight', 'normal');
29 shouldBeEqualToString('faceWithWrongDescriptors.unicodeRange', 'U+0-10FFFF');
30 shouldBeEqualToString('faceWithWrongDescriptors.variant', 'normal');
31 shouldBeEqualToString('faceWithWrongDescriptors.featureSettings', 'normal');
32 faceWithWrongDescriptors.loaded.catch(function(e) {
33 rejectionValue = e;
34 shouldBeEqualToString('rejectionValue.name', 'SyntaxError');
35 finishJSTest();
36 });
39 step1();
40 </script>