[e10s] Fix and re-enable /js/xpconnect/tests/browser_dead_object.js

RESOLVED FIXED in Firefox 47

Status

()

Core
DOM
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: tracy, Assigned: tracy)

Tracking

(Blocks: 1 bug)

Trunk
mozilla47
Points:
---

Firefox Tracking Flags

(e10s+, firefox47 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

2 years ago
Not sure this test case can be made to work in e10s.  Here is what I have.  Will isDeadWrapper work on a browser tab?  My attempts to do this in a ContentTask did not work either.

add_task(function* test() {

  let newTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com");
  yield BrowserTestUtils.removeTab(newTab);
  SimpleTest.executeSoon(function() {
    ok(Components.utils.isDeadWrapper(newTab),
        'Browser should be dead.');
    });
});
(Assignee)

Comment 1

2 years ago
Bill,

Is it possible to make this test case e10s compatible?

For bug 773980, test that Components.utils.isDeadWrapper works as expected.

From skip if comment in browser.ini: 
  skip-if = e10s # Bug ?????? - test touches content (Components.utils.isDeadWrapper(contentWindow) - or maybe isDeadWrapper should take CPOWs into account?)
Flags: needinfo?(wmccloskey)
I think there are a couple ways to do this. One way would be to use a ContentTask, but change how the test makes the wrapper dead. Instead of removing the tab, you would navigate to a different page. The structure would look sort of like this:

- Start up a content task.
- The content task would first get a reference to some part of the old page. Maybe content.document.
- Then it would navigate the page, perhaps with "content.location = 'http://example.com/a';".
- Then you would test that the reference to the old page is dead with isDeadWrapper.

However, one crucial piece is that the old page needs to have an onunload event handler. Otherwise it will go in the bfcache and we can't nuke it. So you'll need to make a test-specific page to start with and add an onunload event handler.
Flags: needinfo?(wmccloskey)
(Assignee)

Comment 3

2 years ago
Created attachment 8725738 [details] [diff] [review]
bug_1242643.patch

Attach the patch in try, that fails on Linux.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=b3fe6042437d
(Assignee)

Comment 4

2 years ago
Created attachment 8725866 [details] [diff] [review]
bug_1242643[2].patch

Solved issue of failures on Linux  (had file path case issue)

https://treeherder.mozilla.org/#/jobs?repo=try&revision=f9a3d53cfcb8
Assignee: nobody → twalker
Attachment #8725738 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8725866 - Flags: review?(jmathies)

Comment 5

2 years ago
Comment on attachment 8725866 [details] [diff] [review]
bug_1242643[2].patch

Review of attachment 8725866 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/xpconnect/tests/browser/browser.ini
@@ +1,4 @@
>  [DEFAULT]
> +support-files =
> +  browser_deadObjectOnUnload.html
> +  

nit - whitespace line below the line with browser_deadObjectOnUnload.html

::: js/xpconnect/tests/browser/browser_dead_object.js
@@ +16,5 @@
> +    yield promise;
> +    return Components.utils.isDeadWrapper(doc);
> +  });
> +  is(contentDocDead, true, "wrapper is dead");
> +  yield BrowserTestUtils.removeTab(newTab); 

nit - trailing whitespace
Attachment #8725866 - Flags: review?(jmathies) → review+
(Assignee)

Comment 6

2 years ago
Created attachment 8725899 [details] [diff] [review]
bug_1242643[2].patch

fixed nits on white space.
Attachment #8725866 - Attachment is obsolete: true
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 7

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d0d03be48b9e
Keywords: checkin-needed

Comment 8

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d0d03be48b9e
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox47: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47

Comment 9

2 years ago
https://hg.mozilla.org/integration/fx-team/rev/d45c2b6da860
You need to log in before you can comment on or make changes to this bug.