Closed
Bug 812114
Opened 12 years ago
Closed 11 years ago
Add an observer for the stop() method in private-browsing.js shared module
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(firefox17 fixed, firefox18 fixed, firefox19 fixed, firefox20 fixed, firefox-esr10 wontfix, firefox-esr17 fixed)
People
(Reporter: AndreeaMatei, Assigned: AndreeaMatei)
References
Details
(Whiteboard: [lib])
Attachments
(2 files, 6 obsolete files)
4.53 KB,
patch
|
davehunt
:
review+
|
Details | Diff | Splinter Review |
4.49 KB,
patch
|
AndreeaMatei
:
review+
whimboo
:
checkin+
|
Details | Diff | Splinter Review |
We need to add an observer for the "last-pb-context-exited" event in order to ensure the private browsing mode was exited. This will be used in the new test for private browsing cache, in bug 789987.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → andreea.matei
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•12 years ago
|
||
Adding the observer to ensure the private browsing mode is exited. Renamed observerService to obs as requested in bug 789987.
Attachment #681978 -
Flags: review?(hskupin)
Attachment #681978 -
Flags: review?(dave.hunt)
Comment 2•12 years ago
|
||
Comment on attachment 681978 [details] [diff] [review] patch v1 Review of attachment 681978 [details] [diff] [review]: ----------------------------------------------------------------- ::: lib/private-browsing.js @@ +202,5 @@ > this._controller.mainMenu.click("#privateBrowsingItem"); > } > > this.waitForTransistionComplete(false); > + assert.waitFor(function () { I don't think we need assert.waitFor here, we could just use utils.waitFor.
Attachment #681978 -
Flags: review?(hskupin)
Attachment #681978 -
Flags: review?(dave.hunt)
Attachment #681978 -
Flags: review-
Assignee | ||
Comment 3•12 years ago
|
||
Updated the assert.waitFor with utils.waitFor
Attachment #681978 -
Attachment is obsolete: true
Attachment #682437 -
Flags: review?(hskupin)
Attachment #682437 -
Flags: review?(dave.hunt)
Comment 4•12 years ago
|
||
Comment on attachment 682437 [details] [diff] [review] patch v2 Review of attachment 682437 [details] [diff] [review]: ----------------------------------------------------------------- ::: lib/private-browsing.js @@ +203,5 @@ > > this.waitForTransistionComplete(false); > + mozmill.utils.waitFor(function () { > + return finishedStateFlag; > + }, "Private browsing was exited"); Do we still need waitForTransitionComplete here? If not I wonder if we could use a similar observer topic for the start() method and get completely get rid of the above mentioned helper method. If the observer doesn't get fired you have to make sure to remove it. This is mainly the reason for r-.
Attachment #682437 -
Flags: review?(hskupin)
Attachment #682437 -
Flags: review?(dave.hunt)
Attachment #682437 -
Flags: review-
Assignee | ||
Comment 5•12 years ago
|
||
I removed the waitForTransistionComplete and it seems it works fine without it as well. Regarding the observer for the start() method, I talked to Josh Matthews about the appropriate event, but there's none we can use. I will get back with an update removing the waitForTransistionComplete call from stop().
Comment 6•12 years ago
|
||
(In reply to Andreea Matei [:AndreeaMatei] from comment #5) > Regarding the observer for the start() method, I talked to Josh Matthews > about the appropriate event, but there's none we can use. What a pity. But ok. > I will get back with an update removing the waitForTransistionComplete call > from stop(). Would it make sense to move the content from waitForTransistionComplete() in start() then? We do not need this method anymore.
Assignee | ||
Comment 7•12 years ago
|
||
Moved the waitForTransistionComplete() in start() method and removed it from stop().
Attachment #682437 -
Attachment is obsolete: true
Attachment #685088 -
Flags: review?(hskupin)
Attachment #685088 -
Flags: review?(dave.hunt)
Comment 8•12 years ago
|
||
Comment on attachment 685088 [details] [diff] [review] patch v3 Review of attachment 685088 [details] [diff] [review]: ----------------------------------------------------------------- ::: lib/private-browsing.js @@ +210,5 @@ > } > > + mozmill.utils.waitFor(function () { > + return finishedStateFlag; > + }, "Private browsing was exited"); As what I already have mentioned in comment 4 in case of a failure we miss to remove the registered observer and this will cause a leak.
Attachment #685088 -
Flags: review?(hskupin)
Attachment #685088 -
Flags: review?(dave.hunt)
Attachment #685088 -
Flags: review-
Assignee | ||
Comment 9•12 years ago
|
||
Ensuring we remove the observer, even if we fail before, with a try-finally block.
Attachment #685088 -
Attachment is obsolete: true
Attachment #686078 -
Flags: review?(hskupin)
Attachment #686078 -
Flags: review?(dave.hunt)
Comment 10•12 years ago
|
||
Comment on attachment 686078 [details] [diff] [review] patch v4 Review of attachment 686078 [details] [diff] [review]: ----------------------------------------------------------------- Looks good now. Only some nits to fix before we can land this. ::: lib/private-browsing.js @@ +185,5 @@ > * @param {boolean} useShortcut > * Use the keyboard shortcut if true otherwise the menu entry is used > */ > + stop: function privateBrowsing_stop(useShortcut) { > + var finishedStateFlag = false; Can you move this down to the observer declaration? @@ +191,5 @@ > if (!this.enabled) > return; > > + // Set up an observer so we get notified when we exited PB > + let observer = { Whether use var or let. I would say we stick with var as we do for all the other modules. @@ +199,2 @@ > } > + try { Please keep a blank line above.
Attachment #686078 -
Flags: review?(hskupin)
Attachment #686078 -
Flags: review?(dave.hunt)
Attachment #686078 -
Flags: review-
Assignee | ||
Comment 11•12 years ago
|
||
Updated the last requests.
Attachment #686078 -
Attachment is obsolete: true
Attachment #686555 -
Flags: review?(hskupin)
Attachment #686555 -
Flags: review?(dave.hunt)
Comment 12•12 years ago
|
||
Comment on attachment 686555 [details] [diff] [review] patch v4.1 Review of attachment 686555 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Landed as: http://hg.mozilla.org/qa/mozmill-tests/rev/f5a6c6b9dfa5
Attachment #686555 -
Flags: review?(hskupin)
Attachment #686555 -
Flags: review?(dave.hunt)
Attachment #686555 -
Flags: review+
Comment 13•12 years ago
|
||
I would like to get this patch backported. Do we know which branches support the observer?
status-firefox20:
--- → fixed
Assignee | ||
Comment 14•12 years ago
|
||
I've checked each branch, the failing ones are ESR10 (on 6 tests from private browsing) and ESR17 (on 1 test), with "Private Browsing was exited" error. I'll look into that more. Aurora, Beta and Release work just fine and the patch applies cleanly to all.
Comment 15•12 years ago
|
||
ESR17 is based on the same code as release right now. So if we fail in ESR17 we should also fail on release. When has the observer been added actually?
Assignee | ||
Comment 16•12 years ago
|
||
Oh, rechecked release now and indeed fails once, as ESR17, at testGeolocation.js. But if the observer wouldn't be added there, we should have all of them failing.
Comment 17•12 years ago
|
||
I'm not following. What's failing? Could you paste a link to a dashboard report?
Comment 18•12 years ago
|
||
I know we failed once but I accidentally landed the new pb test on all other branches. If we still fail in CI we should raise a follow-up bug. http://hg.mozilla.org/qa/mozmill-tests/rev/5e7226a6d415 (aurora) http://hg.mozilla.org/qa/mozmill-tests/rev/92b9f7f67682 (beta) http://hg.mozilla.org/qa/mozmill-tests/rev/a1e39ce1c892 (release) http://hg.mozilla.org/qa/mozmill-tests/rev/d011b6107dd4 (esr17)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
status-firefox-esr10:
--- → wontfix
status-firefox17:
--- → fixed
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
status-firefox-esr17:
--- → fixed
Resolution: --- → FIXED
Assignee | ||
Comment 19•12 years ago
|
||
As expected, this is failing on ESR17, over platforms, for most of the private browsing tests: http://mozmill-ci.blargon7.com/#/functional/report/352218d7e3125c857fc1d37167aff9e2
Comment 20•12 years ago
|
||
Backout from esr17: http://hg.mozilla.org/qa/mozmill-tests/rev/f25449c1ea43
Assignee | ||
Comment 21•12 years ago
|
||
This happens on release as well: http://mozmill-crowd.blargon7.com/#/functional/report/a11aa7b15f4e571fd6fe21a2db0ffc63 The event's existence is not the issue since this is not reproducing constantly, we have passing testruns too. When we fail, the flag is not getting changed to 'true', is 'false' all the way (and we do enter in all blocks - observer, try, waitFor, finally). Will keep investigating after we finish bug 818456 that is P1.
Comment 22•12 years ago
|
||
I would like to know what Josh or Ehsan think about it.
Assignee | ||
Updated•12 years ago
|
Flags: needinfo?(josh)
Comment 23•12 years ago
|
||
So is the issue that the test times out waiting here?
> 211 mozmill.utils.waitFor(function () {
> 212 return finishedStateFlag;
> 213 }, "Private browsing was exited");
Flags: needinfo?(josh)
Assignee | ||
Comment 24•11 years ago
|
||
Yep, sometimes that value is not getting changed in the observer, where we set it true.
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(josh)
Comment 25•11 years ago
|
||
I don't have any particular suggestions, unfortunately. That suggests that the observer isn't triggered, which indicates that private browsing is still in effect :/
Flags: needinfo?(josh)
Comment 26•11 years ago
|
||
Andreea, can you watch such a testrun or slow it down so we might see what's going on? Are all private browsing windows getting closed?
Assignee | ||
Comment 27•11 years ago
|
||
Investigated some more and this is not failing anymore on release. That is because the way "last-pb-context-exited" occurs has changed from release up, explained Josh. Only ESR17 is affected, which can be fixed by using "private-browsing-transition-complete" instead of "last-pb-context-exited". Uploading the patch and reports soon.
Comment 28•11 years ago
|
||
(In reply to Andreea Matei [:AndreeaMatei] from comment #27) > Only ESR17 is affected, which can be fixed by using > "private-browsing-transition-complete" instead of "last-pb-context-exited". > Uploading the patch and reports soon. So the notification message has been changed then? That would totally explain it. Sounds we are on the right track. Thanks Andreea!
Comment 29•11 years ago
|
||
No, there was no change. The difference is in bug 804653, in which the notification becomes independent of non-deterministic factors like garbage collection.
Comment 30•11 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #29) > No, there was no change. The difference is in bug 804653, in which the > notification becomes independent of non-deterministic factors like garbage > collection. So could we use this test as a test for bug 804653? If yes, how should it handle the different kinds of notifications?
Comment 31•11 years ago
|
||
No. The previous behaviour was non-deterministic (eg. the test fails 1/20 times), which is not good for automated tests.
Assignee | ||
Comment 32•11 years ago
|
||
Using the 'private-browsing-transition-complete' notification that fixes the issue. Reports: * OS X: http://mozmill-crowd.blargon7.com/#/functional/report/72e15dc943833b8fcba70aeb5105d4af * Linux: http://mozmill-crowd.blargon7.com/#/functional/report/72e15dc943833b8fcba70aeb510599fa * Windows: http://mozmill-crowd.blargon7.com/#/functional/report/72e15dc943833b8fcba70aeb51064e85
Attachment #704791 -
Flags: review?(hskupin)
Attachment #704791 -
Flags: review?(dave.hunt)
Comment 33•11 years ago
|
||
Comment on attachment 704791 [details] [diff] [review] [ESR17] fix patch Review of attachment 704791 [details] [diff] [review]: ----------------------------------------------------------------- Please try to keep the code as best as possible in sync with the other patch. This will save us a lot of trouble when backporting patches. I would have expected that you only replace the notification topic string.
Attachment #704791 -
Flags: review?(hskupin)
Attachment #704791 -
Flags: review?(dave.hunt)
Attachment #704791 -
Flags: review-
Assignee | ||
Comment 34•11 years ago
|
||
The checked-in patch does no longer apply to ESR17. Left the observer service (it will be taking care of in bug 830688) and removed the constant for the notification, to be in sync.
Attachment #704791 -
Attachment is obsolete: true
Attachment #704823 -
Flags: review?(hskupin)
Attachment #704823 -
Flags: review?(dave.hunt)
Comment 35•11 years ago
|
||
Comment on attachment 704823 [details] [diff] [review] [ESR17] patch Review of attachment 704823 [details] [diff] [review]: ----------------------------------------------------------------- Looks good now but please add a comment for the observer topic used so that we can remember why we have such a difference compared to the other branches. Also include the bug you and Josh were referring to. Once uploaded you can carry forward the r+ flag.
Attachment #704823 -
Flags: review?(hskupin)
Attachment #704823 -
Flags: review?(dave.hunt)
Attachment #704823 -
Flags: review+
Assignee | ||
Comment 36•11 years ago
|
||
Added the comment for the notification.
Attachment #704823 -
Attachment is obsolete: true
Attachment #704858 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 37•11 years ago
|
||
Comment on attachment 704858 [details] [diff] [review] [ESR17] fix patch http://hg.mozilla.org/qa/mozmill-tests/rev/9b2e455887a2 (esr17)
Attachment #704858 -
Flags: checkin+
Comment 38•11 years ago
|
||
Sweet, we are done!
Status: REOPENED → RESOLVED
Closed: 12 years ago → 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Updated•5 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•