gecko-dev/devtools/client/jsonview/test/browser_jsonview_nojs.js
Oriol Brufau 04c1b90604 Bug 1417039 - Do not defer loading JSON Viewer. r=Honza
MozReview-Commit-ID: BtnH41N1w8P

--HG--
extra : rebase_source : 7c6e416f9130fbd9bb6deff2bee9a24fc1a937c0
2017-11-28 16:28:21 +01:00

26 lines
897 B
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function () {
info("Test JSON without JavaScript started.");
let oldPref = SpecialPowers.getBoolPref("javascript.enabled");
SpecialPowers.setBoolPref("javascript.enabled", false);
const TEST_JSON_URL = "data:application/json,[1,2,3]";
// "uninitialized" will be the last app readyState because JS is disabled.
await addJsonViewTab(TEST_JSON_URL, {appReadyState: "uninitialized"});
info("Checking visible text contents.");
let {text} = await executeInContent("Test:JsonView:GetElementVisibleText",
{selector: "html"});
is(text, "[1,2,3]", "The raw source should be visible.");
SpecialPowers.setBoolPref("javascript.enabled", oldPref);
});