chromium/third_party/blink/web_tests/fast/css/font-face-src-escaped-parsing.html

<html>
<head>
    <!-- The testcase input -->
    <style>
        @font-face {
            src: url('http://w/\aaaa/1b\aaaa.ttf');
        }
        @font-face {
            src: url(http://w/\aaaa/1b\aaaa.ttf);
        }
    </style>

    <script src="../../resources/testharness.js"></script>
    <script src="../../resources/testharnessreport.js"></script>

    <script>
        test(function() {
            var styleElm = document.getElementsByTagName("style")[0];
            assert_not_equals(styleElm, null, "Style element exists");
            var stylesheet = styleElm.sheet;
            assert_not_equals(stylesheet, undefined, "style.sheet exists");
            rules = stylesheet.cssRules;
            assert_equals(rules.length, 2, "cssRules.length == 2");
            assert_equals(rules[0].style.cssText, 'src: url("http://w/' + decodeURIComponent("%EA%AA%AA") + "/1b" + decodeURIComponent("%EA%AA%AA") + '.ttf");', "Escaped url string");
            assert_equals(rules[1].style.cssText, 'src: url("http://w/' + decodeURIComponent("%EA%AA%AA") + "/1b" + decodeURIComponent("%EA%AA%AA") + '.ttf");', "Escaped url without string");
        }, "Correctly parsed identifier with escapes");
    </script>
</head>
<body><!-- Intentionally left empty --></body>
</html>