Closed
Bug 806741
Opened 12 years ago
Closed 12 years ago
Port test_bug_461710.html to the new per-tab PB APIs
Categories
(Firefox :: Private Browsing, defect)
Tracking
()
RESOLVED
FIXED
Firefox 20
People
(Reporter: ehsan.akhgari, Assigned: raymondlee)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
8.39 KB,
patch
|
Details | Diff | Splinter Review |
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/tests/mochitest/test_bug_461710.html
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.
Reporter | ||
Comment 1•12 years ago
|
||
Removed this test from per-window PB builds: https://hg.mozilla.org/mozilla-central/rev/d142cca052c3
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → raymond
Assignee | ||
Updated•12 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #693267 -
Flags: review?(ehsan)
Assignee | ||
Comment 3•12 years ago
|
||
Forgot to add a file in last patch
Attachment #693267 -
Attachment is obsolete: true
Attachment #693267 -
Flags: review?(ehsan)
Attachment #693271 -
Flags: review?(ehsan)
Reporter | ||
Updated•12 years ago
|
Attachment #693271 -
Flags: review?(ehsan) → review?(josh)
Comment 4•12 years ago
|
||
Comment on attachment 693271 [details] [diff] [review]
v2
Review of attachment 693271 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/places/tests/mochitest/test_bug_461710.html
@@ +15,5 @@
> <script class="testbody" type="text/javascript">
>
> /** Test for Bug 461710 **/
>
> +netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
We want to avoid adding more of these. Use SpecialPowers when necessary, please. You can usually just use SpecialPowers.wrap(obj).foo when obj.foo requires chrome privileges.
Attachment #693271 -
Flags: review?(josh) → review+
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #4)
> Comment on attachment 693271 [details] [diff] [review]
> v2
>
> Review of attachment 693271 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: toolkit/components/places/tests/mochitest/test_bug_461710.html
> @@ +15,5 @@
> > <script class="testbody" type="text/javascript">
> >
> > /** Test for Bug 461710 **/
> >
> > +netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
>
> We want to avoid adding more of these. Use SpecialPowers when necessary,
> please. You can usually just use SpecialPowers.wrap(obj).foo when obj.foo
> requires chrome privileges.
@Josh: I have tried to remove the netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'), and then added SpecialPowers.wrap to the following code which requires chrome privileges.
+var mainWindow = SpecialPowers.wrap(window)
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShellTreeItem)
+ .rootTreeItem
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindow);
However, I am getting an exception "TypeError: utils.getVisitedDependentComputedStyle" when running the test, and I have tried different ways to resolve this but without luck.
Any suggestions how I can fix that? Thanks
Comment 6•12 years ago
|
||
Actually, I suspect the problem can be solved by ignoring my SpecialPowers advice earlier and making this a mochitest-chrome test instead, so it should run with chrome privileges. It may just be a matter of using MOCHITEST_CHROME_FILES in the makefile instead.
Assignee | ||
Comment 7•12 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #6)
> Actually, I suspect the problem can be solved by ignoring my SpecialPowers
> advice earlier and making this a mochitest-chrome test instead, so it should
> run with chrome privileges. It may just be a matter of using
> MOCHITEST_CHROME_FILES in the makefile instead.
Unfortunately, it didn't work. I got Error: Permission denied for window.QueryInterface(Ci.nsIInterfaceRequestor)... Wrapping it with SpecialPowers.wrap() gave me error as before.
Comment 8•12 years ago
|
||
What's the command you're using to run the test?
Assignee | ||
Comment 9•12 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #8)
> What's the command you're using to run the test?
I use the following, is it the right thing to do?
TEST_PATH=toolkit/components/places/tests/ make -C obj-ff-dbg mochitest-plain
Comment 10•12 years ago
|
||
You need to use the mochitest-chrome target instead of mochitest-plain. You may also need to rebuild the test directory.
Assignee | ||
Comment 11•12 years ago
|
||
I have checked to use run this test as mochitest-chrome
Pushed to try and looking good so far
https://tbpl.mozilla.org/?tree=Try&rev=e0ec03e5a18e
Attachment #693271 -
Attachment is obsolete: true
Comment 12•12 years ago
|
||
It would be worth narrowing future try pushes to just execute the test harness that contains the test you're adding.
Comment 13•12 years ago
|
||
Please can you also cancel previous try runs when you push another iteration, to save resources (particularly helps our most resource constrained platforms, since they are the most likely still not yet started).
https://groups.google.com/d/msg/mozilla.dev.platform/iengKcyD504/DPJeGxOpGw0J
Assignee | ||
Comment 14•12 years ago
|
||
(In reply to Ed Morley [UTC+0; email:edmorley@moco] from comment #13)
> Please can you also cancel previous try runs when you push another
> iteration, to save resources (particularly helps our most resource
> constrained platforms, since they are the most likely still not yet started).
>
> https://groups.google.com/d/msg/mozilla.dev.platform/iengKcyD504/DPJeGxOpGw0J
Sure
Keywords: checkin-needed
Comment 15•12 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 16•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
You need to log in
before you can comment on or make changes to this bug.
Description
•