File: script-charset-02.html

package info (click to toggle)
thunderbird 1%3A52.9.1-1~deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,709,148 kB
  • sloc: cpp: 5,081,792; ansic: 2,051,951; python: 458,733; java: 241,615; xml: 193,600; asm: 178,649; sh: 81,881; makefile: 24,702; perl: 16,874; objc: 4,389; yacc: 1,816; ada: 1,697; lex: 1,257; pascal: 1,251; cs: 879; exp: 499; php: 436; lisp: 258; awk: 152; sed: 51; ruby: 47; csh: 27
file content (40 lines) | stat: -rw-r--r-- 1,626 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<head>
  <!-- TODO:
  askalski: while this test pass, it does not test anything now.
  It should test, whether with no document.charset set in any way, the
  external scripts will get decoded using utf-8 as fallback character encoding.
  It seems like utf-8 is also a fallback encoding to html (my guess), so
  the part of the code I was attempting to test is never reached.
  -->
  <title>Script @type: unknown parameters</title>
  <link rel="author" title="askalski" href="github.com/askalski">
  <link rel="help" href="https://html.spec.whatwg.org/multipage/#scriptingLanguages">
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <div id="log"></div>

  <!-- test of step4, which is taking utf-8 as fallback -->
  <!-- in this case, neither response's Content Type nor charset attribute bring correct charset information.
  Furthermore, document's encoding is not set.-->
  <script type="text/javascript"
    src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript">
  </script>
  <script>
  test(function() {
    //these strings should not match, since the tested file is in windows-1250, and fallback is defined as utf-8
    assert_not_equals(window.getSomeString().length, 5);
  });
  </script>

  <script type="text/javascript"
    src="serve-with-content-type.py?fn=external-script-utf8.js&ct=text/javascript">
  </script>
  <script>
  //these strings should match, since fallback utf-8 is the correct setting.
  test(function() {
    assert_equals(window.getSomeString().length, 5);
  });
  </script>

</head>