Commit ca4179a2 authored by Julian Descottes's avatar Julian Descottes
Browse files

Bug 1755311 - Stop relying on "security.csp.enable" for tests in...

Bug 1755311 - Stop relying on "security.csp.enable" for tests in devtools/client/framework/tests r=devtools-reviewers,freddyb,nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D138770
parent ba777d96
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -34,7 +34,9 @@ support-files =
  doc_cached-resource.html
  doc_cached-resource_iframe.html
  doc_empty-tab-01.html
  doc_lazy_tool.html
  doc_reload.html
  doc_textbox_tool.html
  head.js
  helper_disable_cache.js
  helper_enable_devtools_popup.js
+1 −10
Original line number Diff line number Diff line
@@ -34,15 +34,6 @@ function isPanelReady(toolbox, toolId) {
 * returning. See Bug 1543907.
 */
add_task(async function automaticallyBindTexbox() {
  // We have to disable CSP for this test otherwise the CSP of
  // about:devtools-toolbox will block the data: url.
  await SpecialPowers.pushPrefEnv({
    set: [
      ["security.csp.enable", false],
      ["dom.security.skip_about_page_has_csp_assert", true],
    ],
  });

  info(
    "Registering a tool with an input field and making sure the context menu works"
  );
@@ -50,7 +41,7 @@ add_task(async function automaticallyBindTexbox() {
  gDevTools.registerTool({
    id: lazyToolId,
    isTargetSupported: () => true,
    url: `data:text/html;charset=utf8,Lazy tool`,
    url: CHROME_URL_ROOT + "doc_lazy_tool.html",
    label: "Lazy",
    build: function(iframeWindow, toolbox) {
      this.panel = new LazyDevToolsPanel(iframeWindow, toolbox);
+1 −20
Original line number Diff line number Diff line
@@ -15,15 +15,6 @@ registerCleanupFunction(() => {
});

add_task(async function checkMenuEntryStates() {
  // We have to disable CSP for this test otherwise the CSP of
  // about:devtools-toolbox will block the data: url.
  await SpecialPowers.pushPrefEnv({
    set: [
      ["security.csp.enable", false],
      ["dom.security.skip_about_page_has_csp_assert", true],
    ],
  });

  info("Checking the state of edit menuitems with an empty clipboard");
  const toolbox = await openNewTabAndToolbox(URL, "inspector");

@@ -72,23 +63,13 @@ add_task(async function checkMenuEntryStates() {
});

add_task(async function automaticallyBindTexbox() {
  // We have to disable CSP for this test otherwise the CSP of
  // about:devtools-toolbox will block the data: url.
  await SpecialPowers.pushPrefEnv({
    set: [
      ["security.csp.enable", false],
      ["dom.security.skip_about_page_has_csp_assert", true],
    ],
  });

  info(
    "Registering a tool with an input field and making sure the context menu works"
  );
  gDevTools.registerTool({
    id: textboxToolId,
    isTargetSupported: () => true,
    url: `data:text/html;charset=utf8,<input /><input type='text' />
            <input type='search' /><textarea></textarea><input type='radio' />`,
    url: CHROME_URL_ROOT + "doc_textbox_tool.html",
    label: "Context menu works without tool intervention",
    build: function(iframeWindow, toolbox) {
      this.panel = createTestPanel(iframeWindow, toolbox);
+6 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
<body>
  Lazy tool
</body>
</html>
+10 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
<body>
  <input />
  <input type='text' />
  <input type='search' />
  <textarea></textarea>
  <input type='radio' />
</body>
</html>