Closed Bug 806725 Opened 7 years ago Closed 7 years ago

Port test_localStorageBasePrivateBrowsing.html 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

(2 files, 1 obsolete file)

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.
Removed this test from per-window PB builds: https://hg.mozilla.org/mozilla-central/rev/3c0945f95ceb
Assignee: nobody → bellindira
Status: NEW → ASSIGNED
Attached patch Ported testcase (obsolete) — Splinter Review
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)
That seems wrong.  Josh is looking into this.
Attached patch patchSplinter Review
The test passes with these changes.
Attachment #691548 - Flags: review?(ehsan)
Attachment #691428 - Attachment is obsolete: true
Attachment #691428 - Flags: feedback?(ehsan)
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+
https://hg.mozilla.org/mozilla-central/rev/fd919eb97465
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Attachment #691548 - Attachment description: BugÃÂÂÂÂÂ → patch
Attached patch Fixed typoSplinter Review
Attachment #693639 - Flags: review?(ehsan)
Attachment #693639 - Flags: review?(ehsan) → review+
You need to log in before you can comment on or make changes to this bug.