Closed Bug 806719 Opened 7 years ago Closed 7 years ago

Port browser_cmd_screenshot.js to the new per-tab PB APIs

Categories

(Firefox :: Private Browsing, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 20

People

(Reporter: ehsan, Assigned: bellindira)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

http://mxr.mozilla.org/mozilla-central/source/browser/devtools/commandline/test/browser_cmd_screenshot.js

In order to port this test, the file needs to be copied to the same directory (perhaps with "_perwindowpb" appended to its file name), and then instead of setting privateBrowsingEnabled, we need to open a new private browsing window and then run the test on that window.  Note that the original test should only be added to the list of test files in Makefile.in ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING, and the new test file should be added to the list with the reverse condition.
Assignee: nobody → bellindira
Status: NEW → ASSIGNED
Attached patch Ported testcase (obsolete) — Splinter Review
Attachment #684462 - Flags: review?(ehsan)
Attachment #684462 - Flags: review?(ehsan) → review+
This caused a test failure: https://tbpl.mozilla.org/php/getParsedLog.php?id=17288140&tree=Mozilla-Inbound&full=1 so I backed it out: https://hg.mozilla.org/integration/mozilla-inbound/rev/a852c3f0e2fd

Can you please attach a new version of the patch which fixes this?  Thanks!
The issue was that on head.js I added the following line:

Services.scriptloader.loadSubScript(testDir + "/helpers_perwindowpb.js", this);

and helpers_perwindowpb.js was only added to MOCHITEST_BROWSER_FILES ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING. So, this fix adds the file whether MOZ_PER_WINDOW_PRIVATE_BROWSING is defined or not.

Other solution is adding the script to head.js only if MOZ_PER_WINDOW_PRIVATE_BROWSING is defined. However, I am not sure how to preprocess the head.js on the makefile.

BTW, This patch contains a minor fix in browser_cmd_screenshot_perwindowpb.js.
Attachment #684462 - Attachment is obsolete: true
Attachment #684736 - Flags: review?(ehsan)
Comment on attachment 684736 [details] [diff] [review]
Ported testcase v1

Nice catch!
Attachment #684736 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/5495f10019d3
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Depends on: 824253
You need to log in before you can comment on or make changes to this bug.