Port test_localStorageBasePrivateBrowsing.html to the new per-tab PB APIs

RESOLVED FIXED in Firefox 20

Status

()

Firefox
Private Browsing
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: bellindira)

Tracking

(Blocks: 1 bug)

unspecified
Firefox 20
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

6 years ago
http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing.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

6 years ago
Removed this test from per-window PB builds: https://hg.mozilla.org/mozilla-central/rev/3c0945f95ceb
Assignee: nobody → bellindira
(Assignee)

Updated

6 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

6 years ago
Created attachment 691428 [details] [diff] [review]
Ported testcase

The test is ported however it looks like localStorage works different on private browsing per window than on previous private browsing mode. Because once a new private browsing window is opened and closed, it is not possible to get the values of previous saved items in a normal window. As you will see when running this test, it will throw this error:

113 ERROR TEST-UNEXPECTED-FAIL | chrome://mochitests/content/chrome/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html | back in normal mode - got null, expected persistent1
make: *** [mochitest-chrome] Error 1

Please let me know what I should do on this check.

Thanks
Attachment #691428 - Flags: feedback?(ehsan)
(Reporter)

Comment 3

6 years ago
That seems wrong.  Josh is looking into this.

Comment 4

6 years ago
Created attachment 691548 [details] [diff] [review]
patch

The test passes with these changes.
Attachment #691548 - Flags: review?(ehsan)

Updated

6 years ago
Attachment #691428 - Attachment is obsolete: true
Attachment #691428 - Flags: feedback?(ehsan)
(Reporter)

Comment 5

6 years ago
Comment on attachment 691548 [details] [diff] [review]
patch

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

I have some indentation nits which I fixed myself.  :-)  Thanks everyone!
Attachment #691548 - Flags: review?(ehsan) → review+
(Reporter)

Comment 6

6 years ago
https://hg.mozilla.org/mozilla-central/rev/fd919eb97465
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Attachment #691548 - Attachment description: BugÃÂÂÂÂÂ → patch
This is a typo in this patch.

http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html?force=1#42

win.removeEventListener("DOMConten/tLoaded", onInnerLoad, true);
(Assignee)

Comment 8

6 years ago
Created attachment 693639 [details] [diff] [review]
Fixed typo
Attachment #693639 - Flags: review?(ehsan)

Updated

6 years ago
Attachment #693639 - Flags: review?(ehsan) → review+
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.