Closed
Bug 505611
Opened 16 years ago
Closed 16 years ago
[mozmill] Improve level of testing for testSecurityNotification.js
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: u279076, Assigned: u279076)
Details
Attachments
(1 file, 4 obsolete files)
5.53 KB,
patch
|
u279076
:
review+
|
Details | Diff | Splinter Review |
Proposed changes:
1. Check the actual link reported in the error page, not just that it exists
2. Check the error code is being displayed
3. CSS background image URLs should be url("blah.png") not url(blah.png)
Attachment #389839 -
Flags: review?(hskupin)
Updated•16 years ago
|
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Comment 2•16 years ago
|
||
Comment on attachment 389839 [details] [diff] [review]
Initial patch
>- * The Original Code is Mozmill Test Code.
>- *
Please revert this change.
> * Contributor(s):
> * Aakash Desai <adesai@mozilla.com>
>+ * Anthony Hughes <ashughes@mozilla.com>
Please fix the indentation.
>+var teardownModule = function(module) {
>+ UtilsAPI.closeAllTabs(controller);
>+}
This function is not needed.
>+ * Tests the identify/favicon button and Bad Cert error page
Nit: "Test the..."
>- if (cssSecButton.getPropertyValue('list-style-image') != 'url(chrome://browser/skin/Secure-statusbar.png)') {
>+ if (cssSecButton.getPropertyValue('list-style-image') != 'url("chrome://browser/skin/Secure-statusbar.png")') {
Why it needs quotes around the URL? DOMi doesn't show those for all computes styles.
>+ var link = new elementslib.ID(controller.tabs.activeTab, "cert_domain_link");
>+ controller.waitForElement(link);
>+ controller.assertNode(link);
>+ if (link.getNode().textContent != "www.verisign.com") {
>+ throw "Site link is invalid!";
>+ }
No need for assertNode. And can you please use assertProperty?
>+ // Verify the error code is correct
>+ var text = new elementslib.ID(controller.tabs.activeTab, "technicalContentText");
>+ controller.waitForElement(text);
>+ controller.assertNode(text);
You can remove assertNode here too.
Attachment #389839 -
Flags: review?(hskupin) → review-
I've made all requested revisions save for this one:
>> - if (cssSecButton.getPropertyValue('list-style-image') != 'url(chrome://browser/skin/Secure-statusbar.png)') {
>> + if (cssSecButton.getPropertyValue('list-style-image') != 'url("chrome://browser/skin/Secure-statusbar.png")') {
>
> Why it needs quotes around the URL? DOMi doesn't show those for all computes
> styles.
In the case of "list-style-image" quotes are used in the attribute value. Excluding quotes causes the test to fail 80% of the time I run it. Personally, I think this it is safer to assume quotes. You are right that DOMi doesn't show it for ALL computed styles, but it does for THIS computed style.
A couple of the revisions I implemented but they confuse me:
>> +var teardownModule = function(module) {
>> + UtilsAPI.closeAllTabs(controller);
>> +}
>
> This function is not needed.
It was my understanding that it was a good idea to use this whenever we loaded a page during the test. IMO, all tests should clean up after themselves. Before we never used it, then we did, now we don't again? We've used this recently, why no longer?
>> * Contributor(s):
>> * Aakash Desai <adesai@mozilla.com>
>> + * Anthony Hughes <ashughes@mozilla.com>
>
> Please fix the indentation.
Indenting so that names are right-aligned and emails are right-aligned is more readable IMO.
Attachment #389839 -
Attachment is obsolete: true
Attachment #391374 -
Attachment is patch: true
Attachment #391374 -
Attachment mime type: application/octet-stream → text/plain
Attachment #391374 -
Flags: review?(hskupin)
Comment 4•16 years ago
|
||
(In reply to comment #3)
> > Why it needs quotes around the URL? DOMi doesn't show those for all computes
> > styles.
>
> In the case of "list-style-image" quotes are used in the attribute value.
> Excluding quotes causes the test to fail 80% of the time I run it.
Interesting. I saw failures lately too. Lets see if this fixes it.
> >> +var teardownModule = function(module) {
> >> + UtilsAPI.closeAllTabs(controller);
> >> +}
> >
> > This function is not needed.
> It was my understanding that it was a good idea to use this whenever we loaded
> a page during the test. IMO, all tests should clean up after themselves.
> Before we never used it, then we did, now we don't again? We've used this
> recently, why no longer?
You don't open any additional tabs in your test. So there is nothing you have to restore afterward.
> >> * Contributor(s):
> >> * Aakash Desai <adesai@mozilla.com>
> >> + * Anthony Hughes <ashughes@mozilla.com>
> >
> > Please fix the indentation.
> Indenting so that names are right-aligned and emails are right-aligned is more
> readable IMO.
This is the convention which is used everywhere else. We shouldn't change it. Please also consider really long names which could make it look ugly.
Comment 5•16 years ago
|
||
Comment on attachment 391374 [details] [diff] [review]
Rev1
>- if (cssSecButton.getPropertyValue('list-style-image') != 'url(chrome://browser/skin/Secure-statusbar.png)') {
>+ if (cssSecButton.getPropertyValue('list-style-image') != 'url("chrome://browser/skin/Secure-statusbar.png")') {
Now I know why it failed. I forgot the remove the patch from the last review. As what I can see we really cannot go this way. The url cannot have quotes around the uri. It always fails for me.
Further and the most annoying problem is, that the whole test doesn't work on Windows. The list-style-image is different on OS X, Windows, and probably Linux too. So whether we compare another uri for each OS or we simply trust and use "x != ''". I would tend to do the latter way for now. Probably this also affects the other comparisons.
Attachment #391374 -
Flags: review?(hskupin) → review-
(In reply to comment #5)
> (From update of attachment 391374 [details] [diff] [review])
> >- if (cssSecButton.getPropertyValue('list-style-image') != 'url(chrome://browser/skin/Secure-statusbar.png)') {
> >+ if (cssSecButton.getPropertyValue('list-style-image') != 'url("chrome://browser/skin/Secure-statusbar.png")') {
>
> Now I know why it failed. I forgot the remove the patch from the last review.
> As what I can see we really cannot go this way. The url cannot have quotes
> around the uri. It always fails for me.
>
It always fails for me without quotes. Using DOMi, list-style-image has quotes. Please advise.
Comment 7•16 years ago
|
||
Please don't run the tests in Minefield until we decided to branch for 3.5. As what I can see the quotes are only existent on trunk. For now we stay on 3.5. Please make a comment so we know that we have to change it once we have branched.
We'll be branching soon, no? Why don't I just wait until then. This will save us all the hassle.
Comment 9•16 years ago
|
||
There is no ETA yet. Since at least I run daily Mozmill tests against Shiretoko that would be counter-productive. We would have to change it in any way for 3.5 after the branching. So just let us use it without quotes for now.
Assignee | ||
Comment 10•16 years ago
|
||
When you say Shiretoko, 3.5.2 should be ok to use?
Comment 11•16 years ago
|
||
Sure, any version from the 1.9.1 branch.
Assignee | ||
Comment 12•16 years ago
|
||
Suggested revisions made...please review.
Attachment #391374 -
Attachment is obsolete: true
Attachment #392615 -
Flags: review?(hskupin)
Comment 13•16 years ago
|
||
Comment on attachment 392615 [details] [diff] [review]
Rev2
Please see my second paragraph in comment 5. The test doesn't work on Windows.
Please test at least on Windows too before requesting a review.
Attachment #392615 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 14•16 years ago
|
||
(In reply to comment #13)
> (From update of attachment 392615 [details] [diff] [review])
> Please see my second paragraph in comment 5. The test doesn't work on Windows.
>
> Please test at least on Windows too before requesting a review.
I test on Mac, Windows and Linux before submitting for review. It works for me on all platforms.
Comment 15•16 years ago
|
||
Anthony, I don't blame you. This failure went in with the test from Aakash. But as you can read in comment 5 it cannot work. The check for the background url of the security-button will fail an Windows and Linux because on OS X it is a different one.
http://mxr.mozilla.org/mozilla1.9.1/source/browser/themes/winstripe/browser/browser.css#1294
http://mxr.mozilla.org/mozilla1.9.1/source/browser/themes/pinstripe/browser/browser.css#1400
http://mxr.mozilla.org/mozilla1.9.1/source/browser/themes/gnomestripe/browser/browser.css#1122
Further is bug 503480 not an issue for you anymore?
So can you please make the change?
Assignee | ||
Comment 16•16 years ago
|
||
> Further and the most annoying problem is, that the whole test doesn't work on
> Windows. The list-style-image is different on OS X, Windows, and probably Linux
> too. So whether we compare another uri for each OS or we simply trust and use
> "x != ''". I would tend to do the latter way for now. Probably this also
> affects the other comparisons.
Upon further investigation, I found the list-style-image attribute is set to "none" when the icon is not visible. Checking for x != 'none' is far better than x != '' IMO. In fact, it's probably an approach we want to take in the future for all images which are "hidden".
Patch to follow...
Assignee | ||
Comment 17•16 years ago
|
||
Here is the full test. HG is currently down...
Please review and we can create a patch later.
Attachment #392615 -
Attachment is obsolete: true
Attachment #395487 -
Flags: review?(hskupin)
Comment 18•16 years ago
|
||
Anthony, I wonder a bit about the needs for this Mozmill test at all when seeing your 3 tests for each larry state (green, blue, gray). I feel we should move everything from this test into the comprehensive tests on bug 511208, bug 511314, and bug 511318. What do you think?
Assignee | ||
Comment 19•16 years ago
|
||
I'll review and get back to you on this.
Comment 20•16 years ago
|
||
We should go with this test. Even when some parts are duplicated. Security is a major area so we can have a duplicate. I will check this test today.
Comment 21•16 years ago
|
||
Comment on attachment 395487 [details]
Revised test
We have to do some updates to get it working on all platforms. Given the fact it is a smoketest we need it definitely.
Attachment #395487 -
Flags: review?(hskupin) → review-
Comment 22•16 years ago
|
||
This test works for Firefox 3.5.3 and the latest Namoroka nightly build. Anthony can you please check if everything is ok? Thanks.
Attachment #395487 -
Attachment is obsolete: true
Attachment #396866 -
Flags: review?(ashughes)
Assignee | ||
Comment 23•16 years ago
|
||
Comment on attachment 396866 [details] [diff] [review]
Patch for all platforms
Code looks fine. Test passes. R+
Attachment #396866 -
Flags: review?(ashughes) → review+
Comment 24•16 years ago
|
||
Thanks Anthony. Updates have been landed on both branches:
http://hg.mozilla.org/qa/mozmill-tests/rev/20906d98da60
http://hg.mozilla.org/qa/mozmill-tests/rev/51cb4f07587d
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 25•15 years ago
|
||
Mass move of Mozmill Test related project bugs to newly created components. You can filter out those emails by using "Mozmill-Tests-to-MozillaQA" as criteria.
Component: Security → Mozmill Tests
Product: Firefox → Mozilla QA
QA Contact: firefox → mozmill-tests
Updated•6 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
•