Closed Bug 952125 Opened 11 years ago Closed 11 years ago

Master Dialog Modal is hanging in /restartTests\testPreferences_masterPassword\test2.js

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(firefox26 fixed, firefox27 fixed, firefox28 fixed, firefox29 fixed, firefox-esr24 fixed)

RESOLVED FIXED
Tracking Status
firefox26 --- fixed
firefox27 --- fixed
firefox28 --- fixed
firefox29 --- fixed
firefox-esr24 --- fixed

People

(Reporter: cosmin-malutan, Assigned: cosmin-malutan)

References

Details

Attachments

(1 file)

With bug 951628 and bug 950003 landed the Master Password Modal is hanging in /restartTests\testPreferences_masterPassword\test2.js.
As a workaround for this I focused the hiddenDOMWindow at the beginning of callbackHandler and blur it at the finnal:

http://hg.mozilla.org/qa/mozmill-tests/file/39901d638d4a/firefox/tests/functional/restartTests/testPreferences_masterPassword/test2.js#l97
>var checkMasterHandler = function(controller) {
>  Services.appShell.hiddenDOMWindow.focus();
Attached patch patch v1.0Splinter Review
This failed due to fact that after we save a password on a page, restart the browser and navigate to the same page we will be prompted to give the master password.
Doing so at the beginning of the test2 the modal rise, and as it will steal focus and go unhandled without to be closed will determine the test to hang(bug 951628).

As all of this is expected the best we can do here is to navigate to a diffrent page in tearDown in test1 after we save the password.
Assignee: nobody → cosmin.malutan
Status: NEW → ASSIGNED
Attachment #8350119 - Flags: review?(andrei.eftimie)
Attachment #8350119 - Flags: review?(andreea.matei)
Comment on attachment 8350119 [details] [diff] [review]
patch v1.0

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

Great find!

We never really handled that dialog before.
This makes the test more robust.

Landed:
http://hg.mozilla.org/qa/mozmill-tests/rev/49d403ae6c90 (default)
Attachment #8350119 - Flags: review?(andrei.eftimie)
Attachment #8350119 - Flags: review+
Attachment #8350119 - Flags: checkin+
Component: Mozmill Automation → Mozmill Tests
We'll want to backport this.
Attachment #8350119 - Flags: review?(andreea.matei)
Comment on attachment 8350119 [details] [diff] [review]
patch v1.0

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

::: firefox/tests/functional/restartTests/testPreferences_masterPassword/test1.js
@@ +24,5 @@
>    aModule.tabBrowser.closeAllTabs();
>  }
>  
>  var teardownModule = function(aModule) {
> +  controller.open("about:newtab");

Why can't we handle the modal dialog instead after the restart? That's how it should work and tested. The code here I see only as a workaround.
Attachment #8350119 - Flags: feedback-
(In reply to Henrik Skupin (:whimboo) from comment #5)
> Why can't we handle the modal dialog instead after the restart? That's how
> it should work and tested. The code here I see only as a workaround.

We could also do that and it should also work.

But the way the test is written, this modal dialog is not intended. We do not expect a modal dialog be shown right after a restart. We only work on the Panel in test2, we shouldn't also have to handle the page again.

For clarity we chose to properly clean up instead of handling unexpected cases.

If you feel strongly about this, please let me know and we'll change this to handle the modal dialog instead.
(In reply to Andrei Eftimie from comment #6)
> But the way the test is written, this modal dialog is not intended. We do
> not expect a modal dialog be shown right after a restart. We only work on
> the Panel in test2, we shouldn't also have to handle the page again.

Why is this modal dialog not intended to be shown? If a password has been stored for a page, it will be used the next time the browser opens. And if a master password is set it should be asked. We don't have the Litmus test anymore but I strongly feel that with this little change in test2.js we can improve the testcoverage a lot and make sure that we do not regress this feature. Keep in mind that this test will only work with Mozmill due to the restart, so it's not covered somewhere else yet. So working around it it's a step back.

> For clarity we chose to properly clean up instead of handling unexpected
> cases.

We should do this in the teardown method of test2.js, so that test3.js doesn't bring up the dialog again.
If I try to handle the modal in the second test it works only with mozmill 2.0, but not with 1.5. Because 1.5 is quite slower so the modal is shown before we have time to set the handler.

Also we only have to type the master password only once in a session, and we do so in test2. If we want to cover this in our test I would suggest that at the end of the test2 we navigate back to log-in page and check that the password was stored, which at this point the master password has already been given.
In that case we might want to file a new bug where we could inject another test module with only that specific check. We can work on it once 2.0 has been proven as stable over the next couple of days.
So lets get this patch backported and closed in favor of a follow-up bug.
Blocks: 952436
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: