browser_webconsole_error_with_unicode.js (799B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 // Check if an error with Unicode characters is reported correctly. 5 6 "use strict"; 7 8 const TEST_URI = 9 "data:text/html;charset=utf8,<!DOCTYPE html><script>\u6e2c</script>"; 10 const EXPECTED_REPORT = "ReferenceError: \u6e2c is not defined"; 11 12 add_task(async function () { 13 const hud = await openNewTabAndConsole(TEST_URI); 14 15 // On e10s, the exception is triggered in child process 16 // and is ignored by test harness 17 if (!Services.appinfo.browserTabsRemoteAutostart) { 18 expectUncaughtException(); 19 } 20 21 info("generate exception and wait for the message"); 22 23 const msg = await waitFor(() => findErrorMessage(hud, EXPECTED_REPORT)); 24 ok(msg, `Message found: "${EXPECTED_REPORT}"`); 25 });