mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
04c1b90604
MozReview-Commit-ID: BtnH41N1w8P --HG-- extra : rebase_source : 7c6e416f9130fbd9bb6deff2bee9a24fc1a937c0
26 lines
897 B
JavaScript
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);
|
|
});
|