Closed Bug 1100698 Opened 5 years ago Closed 5 years ago

Fix browser_save_video.js to work in e10s mode

Categories

(Firefox :: Menus, defect)

defect
Not set
Points:
8

Tracking

()

RESOLVED FIXED
Firefox 40
Iteration:
40.2 - 27 Apr
Tracking Status
e10s + ---
firefox40 --- fixed

People

(Reporter: Gijs, Assigned: enndeakin)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This test has lots of issues. For one, it relies on the context menu to open, which kind of puts it in the same boat as bug 1093155, except it doesn't use document.popupNode. It *does* use synthesizeMouseAtCenter, which doesn't work in e10s (bug 933103).

Manually triggering the popup reveals a lot more shenanigans:

7 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 0x2 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype._unremotePrincipal:825
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1301
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
8 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 0x2 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype._unremotePrincipal:825
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1301
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
9 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 0x2 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
resource://gre/modules/BrowserUtils.jsm:this.BrowserUtils.urlSecurityCheck:49
chrome://global/content/contentAreaUtils.js:urlSecurityCheck:39
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1300
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
10 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 002 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
resource://gre/modules/BrowserUtils.jsm:this.BrowserUtils.urlSecurityCheck:49
chrome://global/content/contentAreaUtils.js:urlSecurityCheck:39
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1300
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
11 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 002 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
resource://gre/modules/BrowserUtils.jsm:this.BrowserUtils.urlSecurityCheck:49
chrome://global/content/contentAreaUtils.js:urlSecurityCheck:39
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1300
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
12 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 002 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
resource://gre/modules/BrowserUtils.jsm:this.BrowserUtils.urlSecurityCheck:49
chrome://global/content/contentAreaUtils.js:urlSecurityCheck:39
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1300
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
13 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 002 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
resource://gre/modules/BrowserUtils.jsm:this.BrowserUtils.urlSecurityCheck:49
chrome://global/content/contentAreaUtils.js:urlSecurityCheck:39
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1300
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
14 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js | uncaught exception - NS_NOINTERFACE: Component returned failure code: 002 (NS_NOINTERFACE) [nsISupports.QueryInterface] at :0
Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:1346
resource://gre/modules/BrowserUtils.jsm:this.BrowserUtils.urlSecurityCheck:49
chrome://global/content/contentAreaUtils.js:urlSecurityCheck:39
chrome://browser/content/nsContextMenu.js:nsContextMenu.prototype.saveMedia:1300
chrome://browser/content/browser.xul:oncommand:1
chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:contextMenuOpened:60
null:null:0
JavaScript error: , line 0: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]
WARNING: content window passed to PrivateBrowsingUtils.isWindowPrivate. Use isContentWindowPrivate instead (but only for frame scripts).
pbu_isWindowPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:25:14
nsContextMenu.prototype.saveHelper@chrome://browser/content/nsContextMenu.js:1233:26
nsContextMenu.prototype.saveMedia@chrome://browser/content/nsContextMenu.js:1303:7
oncommand@chrome://browser/content/browser.xul:1:1
contextMenuOpened@chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video.js:60:5
15 INFO context-savevideo command executed
Flags: qe-verify-
Flags: in-testsuite+
Flags: firefox-backlog+
Oh, and last but not least, the current timeout causes the cleanup function of the *next* test to throw an error:

861 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_save_video_frame.js | Cleanup function threw an exception - [Exception... "Component r failure code: 0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED) [nsIComponentRegistrar.unregisterFactory]"  nsresult: "0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)"  location: "JS frame :: resource://ules/RemoteAddonsParent.jsm :: ComponentRegistrarInterposition.methods.unregisterFactory :: line 270"  data: no]
e10s test bugs should block tracking-e10s=+
This also fixes browser_default_image_filename.js which is a similar test.
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Iteration: --- → 40.2 - 27 Apr
Attachment #8593553 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 8593553 [details] [diff] [review]
browser_save_video.js

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

r=me with the below addressed

::: browser/base/content/test/general/browser_save_video.js
@@ +32,5 @@
>  
> +  MockFilePicker.displayDirectory = destDir;
> +  MockFilePicker.showCallback = function(fp) {
> +    fileName = fp.defaultString;
> +    destFile.append (fileName);

Nit: if we're touching this anyway, please fix this style issue (space before (fileName)).

@@ +58,2 @@
>  
> +  let popupHiddenPromise = BrowserTestUtils.waitForEvent(document, "popuphidden");

Seems like this should be on the popup in question?

@@ +64,4 @@
>  
> +  mockTransferRegisterer.unregister();
> +  MockFilePicker.cleanup();
> +  destDir.remove(true);

This should be in a cleanup function like it was before, right?
Attachment #8593553 - Flags: review?(gijskruitbosch+bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/770a4531f5d6
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
You need to log in before you can comment on or make changes to this bug.