summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/unit/test_textDecoder.js
blob: 0b31750a49558a3c97c707bf2673a6dca1d8678d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function run_test() {
  var Cu = Components.utils;
  sb = new Cu.Sandbox('http://www.example.com',
                      { wantGlobalProperties: ["TextDecoder", "TextEncoder"] });
  sb.do_check_eq = do_check_eq;
  Cu.evalInSandbox('do_check_eq(new TextDecoder().encoding, "utf-8");' +
                   'do_check_eq(new TextEncoder().encoding, "utf-8");',
                   sb);
  Cu.importGlobalProperties(["TextDecoder", "TextEncoder"]);
  do_check_eq(new TextDecoder().encoding, "utf-8");
  do_check_eq(new TextEncoder().encoding, "utf-8");
}