Closed Bug 511208 Opened 15 years ago Closed 15 years ago

[mozmill] Test for verifying GREEN Larry

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: u279076, Assigned: u279076)

Details

Attachments

(2 files, 3 obsolete files)

This is a placeholder bug for creating a Mozmill test script for https://litmus.mozilla.org/show_test.cgi?id=6776
Attached patch Initial patch (obsolete) — Splinter Review
Attachment #395204 - Flags: review?(hskupin)
Attached patch Initial patch (obsolete) — Splinter Review
Attachment #395204 - Attachment is obsolete: true
Attachment #395205 - Flags: review?(hskupin)
Attachment #395204 - Flags: review?(hskupin)
Attached patch Rev1 (obsolete) — Splinter Review
Fixed some commenting/formatting issues
Attachment #395205 - Attachment is obsolete: true
Attachment #395222 - Flags: review?(hskupin)
Attachment #395205 - Flags: review?(hskupin)
Status: NEW → ASSIGNED
Comment on attachment 395222 [details] [diff] [review]
Rev1

Most review comments would be the same like in bug 511318. I'll leave them out here. It's a really huge test here.

>+// Include necessary modules
>+var RELATIVE_ROOT = '../../shared-modules';
>+var MODULE_REQUIRES = ['UtilsAPI'];

I haven't seen any usage, so we can remove it.

>+  // Get the information from the certificate for comparison
>+  var cert = controller.window.getBrowser().mCurrentBrowser.securityUI
>+               .QueryInterface(Components.interfaces.nsISSLStatusProvider)
>+                 .SSLStatus.serverCert;  

Can you please use a temporary variable like securityUI and split the line? 

>+  // Check the label displays
>+  // Format: Organization (CountryCode)
>+  var identLabel = new elementslib.ID(controller.window.document, "identity-icon-label");
>+  var certIdent = cert.organization + ' (' +
>+                  cert.subjectName.substring(cert.subjectName.indexOf("C=")+2, 
>+                                             cert.subjectName.indexOf(",serialNumber=")) + ')';

Please move the sub string creation to its own line too.

>+  // Check for the Lock icon is visible
>+  var cssInfoLockImage = controller.window.getComputedStyle(controller.window.document.getElementById("identity-popup-encryption-icon"), "");
>+  if (cssInfoLockImage.getPropertyValue('list-style-image') != 'url(chrome://browser/skin/Secure-Glyph-White.png)') {
>+    throw "Larry Lock image is not displayed";
>+  }

Can we check for != "" here? And please use assertJS instead of a manual throw statement.

>+  // Check the site identifier string against the Cert
>+  // XXX: https://bugzilla.mozilla.org/show_bug.cgi?id=443116

Just say "Bug 443116"

>+  var gETLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"]
>+                       .getService(Components.interfaces.nsIEffectiveTLDService);

Please use Cc and Ci and indent the second line correctly. The "." you can put under the first quote sign.

>+  controller.assertProperty(new elementslib.ID(controller.window.document, "identity-popup-content-host"), 
>+                            "textContent", gETLDService.getBaseDomainFromHost(cert.commonName));

Please separate this line and others too if time permits.

>+  // Check the owner location string against the Cert
>+  // Format: City
>+  //         State, Country Code
>+  var location = cert.subjectName.substring(cert.subjectName.indexOf("L=")+2, cert.subjectName.indexOf(",ST=")) + '\n' + 
>+				 cert.subjectName.substring(cert.subjectName.indexOf("ST=")+3, cert.subjectName.indexOf(",postalCode=")) + ', ' + 
>+				 cert.subjectName.substring(cert.subjectName.indexOf("C=")+2, cert.subjectName.indexOf(",serialNumber="));

That's a huge statement. Please use the correct indentation. Make it left align after the '='.
Attachment #395222 - Flags: review?(hskupin) → review-
Attached patch Rev2Splinter Review
FYI, UtilsAPI is used (Line 121, 127).
Attachment #395222 - Attachment is obsolete: true
Attachment #397143 - Flags: review?(hskupin)
Attachment #397143 - Flags: review?(hskupin) → review+
Comment on attachment 397143 [details] [diff] [review]
Rev2

Looks great. Thanks Anthony. I made some small changes which I will attach as a formal diff.
Attached patch Some fixesSplinter Review
Just to let you know what has been changed.
Landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/0eee3559f07f
http://hg.mozilla.org/qa/mozmill-tests/rev/e2bbd900bc90

For 1.9.1 I had to land a follow-up because the page info window wasn't closed:
http://hg.mozilla.org/qa/mozmill-tests/rev/6fae0da13cf8
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
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
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: