[e10s] browser_markupview_mutation_02.js causes unsafe CPOW usage warnings

RESOLVED DUPLICATE of bug 1252099

Status

RESOLVED DUPLICATE of bug 1252099
3 years ago
2 months ago

People

(Reporter: Kwan, Unassigned)

Tracking

(Blocks: 2 bugs)

Trunk
Dependency tree / graph

Firefox Tracking Flags

(e10s+)

Details

(Whiteboard: [unsafe-cpow-usage])

(Reporter)

Description

3 years ago
Mined from test logs

In browser/devtools/markupview/test/browser_markupview_mutation_02.js:

const TEST_DATA = [{
  desc: "Adding a new node should flash the new node",
  mutate: (doc, rootNode) => {
    let newLi = doc.createElement("LI"); <- Causes CPOW warning
    newLi.textContent = "new list item"; <- Causes CPOW warning
    rootNode.appendChild(newLi); <- Causes CPOW warning
  },
  flashedNode: ".list li:nth-child(3)"
}, {
  desc: "Removing a node should flash its parent",
  mutate: (doc, rootNode) => {
    rootNode.removeChild(rootNode.lastElementChild); <- Causes CPOW warning
  }
}, {
  desc: "Re-appending an existing node should only flash this node",
  mutate: (doc, rootNode) => {
    rootNode.appendChild(rootNode.firstElementChild); <- Causes CPOW warning
  },
  flashedNode: ".list .item:last-child"
}, {
  desc: "Adding an attribute should flash the node",
  mutate: (doc, rootNode) => {
    rootNode.setAttribute("name-" + Date.now(), "value-" + Date.now()); <- Causes CPOW warning
  }
}, {
  desc: "Editing an attribute should flash the node",
  mutate: (doc, rootNode) => {
    rootNode.setAttribute("class", "list value-" + Date.now()); <- Causes CPOW warning
  }
}, {
  desc: "Removing an attribute should flash the node",
  mutate: (doc, rootNode) => {
    rootNode.removeAttribute("class"); <- Causes CPOW warning
  }
}];

add_task(function*() {
  let {inspector} = yield addTab(TEST_URL).then(openInspector);

  // Make sure mutated nodes flash for a very long time so we can more easily
  // assert they do
  inspector.markup.CONTAINER_FLASHING_DURATION = 1000 * 60 * 60;

  info("Getting the <ul.list> root node to test mutations on");
  let rootNode = getNode(".list");
  let rootNodeFront = yield getNodeFront(".list", inspector);

  info("Selecting the last element of the root node before starting");
  yield selectNode(".list .item:nth-child(2)", inspector);

  for (let {mutate, flashedNode, desc} of TEST_DATA) {
    info("Starting test: " + desc);

    info("Mutating the DOM and listening for markupmutation event");
    let mutated = inspector.once("markupmutation");
    let updated = inspector.once("inspector-updated");
    mutate(content.document, rootNode); <- Causes CPOW warning
    yield mutated;

    info("Asserting that the correct markup-container is flashing");
    let flashingNodeFront = rootNodeFront;
    if (flashedNode) {
      flashingNodeFront = yield getNodeFront(flashedNode, inspector);
    }
    yield assertNodeFlashing(flashingNodeFront, inspector);

    // Making sure the inspector has finished updating before moving on
    yield updated;
  }
});

Updated

3 years ago
Blocks: 984139
tracking-e10s: ? → m8+
tracking-e10s: m8+ → ---
Whiteboard: [unsafe-cpow-usage]
This is test only.
tracking-e10s: --- → +
Inspector bug triage. Filter on CLIMBING SHOES

Fixed by Bug 1252099.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1252099

Updated

2 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.