browser_jsonview_nul.js (484B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 add_task(async function () { 7 info("Test JSON with NUL started."); 8 9 const TEST_JSON_URL = 'data:application/json,"foo_%00_bar"'; 10 await addJsonViewTab(TEST_JSON_URL); 11 12 await selectJsonViewContentTab("rawdata"); 13 const rawData = await getElementText(".textPanelBox .data"); 14 is(rawData, '"foo_\u0000_bar"', "The NUL character has been preserved."); 15 });