fune/devtools/client/jsonview/test/browser_jsonview_copy_headers.js
Nicolas Chevobbe 925311bc77 Bug 1568779 - Remove editors settings comments in devtools files. r=pbro.
Differential Revision: https://phabricator.services.mozilla.com/D42300

--HG--
extra : moz-landing-system : lando
2019-08-19 12:48:16 +00:00

38 lines
1 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_JSON_URL = URL_ROOT + "valid_json.json";
add_task(async function() {
info("Test valid JSON started");
await addJsonViewTab(TEST_JSON_URL);
// Select the RawData tab
await selectJsonViewContentTab("headers");
// Check displayed headers
const count = await getElementCount(".headersPanelBox .netHeadersGroup");
is(count, 2, "There must be two header groups");
const text = await getElementText(".headersPanelBox .netInfoHeadersTable");
isnot(text, "", "Headers text must not be empty");
const browser = gBrowser.selectedBrowser;
// Verify JSON copy into the clipboard.
await waitForClipboardPromise(
function setup() {
BrowserTestUtils.synthesizeMouseAtCenter(
".headersPanelBox .toolbar button.copy",
{},
browser
);
},
function validator(value) {
return value.indexOf("application/json") > 0;
}
);
});