[e10s] test-tab.js causes unsafe CPOW usage warnings

RESOLVED FIXED in Firefox 50

Status

Add-on SDK
General
P1
normal
RESOLVED FIXED
3 years ago
a year ago

People

(Reporter: mconley, Assigned: rpl)

Tracking

(Blocks: 2 bugs)

unspecified
mozilla52
Dependency tree / graph

Firefox Tracking Flags

(e10s+, firefox50 fixed, firefox51 fixed, firefox52 fixed)

Details

(Whiteboard: [unsafe-cpow-usage])

Attachments

(1 attachment)

Mined from test logs

In addon-sdk/source/test/tabs/test-tab.js:

https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/test/test-tab.js#l66
https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/test/test-tab.js#l71
https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/test/test-tab.js#l72
https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/test/test-tab.js#l77
https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/test/test-tab.js#l78
https://hg.mozilla.org/projects/holly/file/50e197279ad5/addon-sdk/source/test/test-tab.js#l83

function step2(url, assert) {

  tabs.open({
    url: url,
    onReady: function(tab) {
      primaryTab = tab;
      let window = windowUtils.activeBrowserWindow.content;

      let matchedTab = getTabForWindow(window);
      assert.equal(matchedTab, tab,
        "We are able to find the tab with his content window object");

      let timer = require("sdk/timers");
      function waitForFrames() {
        let iframe = window.document.getElementById("iframe"); <-- causes unsafe CPOW usage warning
        if (!iframe) {
          timer.setTimeout(waitForFrames, 100);
          return;
        }
        iframeWin = iframe.contentWindow; <-- causes unsafe CPOW usage warning
        let subIframe = iframeWin.document.getElementById("sub-iframe"); <-- causes unsafe CPOW usage warning
        if (!subIframe) {
          timer.setTimeout(waitForFrames, 100);
          return;
        }
        let subIframeWin = subIframe.contentWindow; <-- causes unsafe CPOW usage warning
        let subSubIframe = subIframeWin.document.getElementById("sub-sub-iframe"); <-- causes unsafe CPOW usage warning
        if (!subSubIframe) {
          timer.setTimeout(waitForFrames, 100);
          return;
        }
        let subSubIframeWin = subSubIframe.contentWindow; <-- causes unsafe CPOW usage warning

        matchedTab = getTabForWindow(iframeWin);
        assert.equal(matchedTab, tab,
          "We are able to find the tab with an iframe window object");

        matchedTab = getTabForWindow(subIframeWin);
        assert.equal(matchedTab, tab,
          "We are able to find the tab with a sub-iframe window object");

        matchedTab = getTabForWindow(subSubIframeWin);
        assert.equal(matchedTab, tab,
          "We are able to find the tab with a sub-sub-iframe window object");

        // Put our primary tab in the background and test again.
        // The onActivate listener will take us to step3.
        auxTab.activate();
      }
      waitForFrames();
    }
  });
}
tracking-e10s: m8+ → ---
Whiteboard: [unsafe-cpow-usage]
This is test only.
tracking-e10s: --- → +

Comment 2

a year ago
Luca has fix believes
Flags: needinfo?(lgreco)
(Assignee)

Comment 3

a year ago
Created attachment 8802166 [details] [diff] [review]
bug1149162-test-tab-cpow.patch

The cpows usage described in Comment 0 has been fixed by Bug 1171515 (which has been merge into mozilla-central as part of Bug 1179013).

Nevertheless, in the meantime this test file has got a new single cpow usage which has been added by Bug 1179013, which means that I added the only cpow currently used in this test file :-(

This cpow usage can be removed by the tests by using the message manager to retrieve the current value of the document.readyState, without using the CPOW.

I'm attaching the patch that remove the cpow usage from this test, using the strategy described above.
Flags: needinfo?(lgreco)
Attachment #8802166 - Flags: review?(dtownsend)
Attachment #8802166 - Flags: review?(dtownsend) → review+
(Assignee)

Comment 4

a year ago
Pushed to try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c058a8366249c3620e848bc265fde74671fef011
(Assignee)

Updated

a year ago
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
(Assignee)

Updated

a year ago
Keywords: checkin-needed

Comment 5

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3b4965bb11c0
Remove CPOW shim usage in SDK test-tab test related to tab.readyState. r=Mossop
Keywords: checkin-needed

Comment 6

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/3b4965bb11c0
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52

Comment 7

a year ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-aurora/rev/188c28fdb1aa
status-firefox51: --- → fixed

Comment 8

a year ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-beta/rev/79247eb8ce1f
status-firefox50: --- → fixed
You need to log in before you can comment on or make changes to this bug.