Open Bug 446259 Opened 13 years ago Updated 13 years ago

Automate litmus test Testcase ID #4665 - Removed download entries should not be searchable

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

ASSIGNED

People

(Reporter: poonaatsoc, Assigned: poonaatsoc)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file, 1 obsolete file)

Proposed type of test: chrome

Proposed location of test: toolkit/mozapps/downloads/tests/chrome
Attached patch v1.0 (obsolete) — Splinter Review
Test run : Passes
Attachment #330439 - Flags: review?(sdwilsh)
Attached patch v2.0Splinter Review
Test updated to accommodate the updated utils.js.  The test passes
Attachment #330439 - Attachment is obsolete: true
Attachment #331492 - Flags: review?(sdwilsh)
Attachment #330439 - Flags: review?(sdwilsh)
Product: Firefox → Toolkit
Comment on attachment 331492 [details] [diff] [review]
v2.0

>+/**
>+ * This tests bug 446259.  This test basically checks if the search list displays
>+ * any items, for entering the names of deleted downloads into the search box.
>+ */
I didn't catch this in any of my earlier reviews, but the bug number is only useful for code changes.  I just assumed that it was pointing to a bug that made some bug fix.  Please don't add bug numbers when it just points to the "make this litmus test automated" bug.  If the litmus test was created because of an actual bug, it should reference that.

>+function runTest()
>+{
>+  const dmui = Cc["@mozilla.org/download-manager-ui;1"].
>+             getService(Ci.nsIDownloadManagerUI);
>+  const dm = Cc["@mozilla.org/download-manager;1"].
>+           getService(Ci.nsIDownloadManager);
s/const/let/

>+  let testObs = {
>+    observe: function(aSubject, aTopic, aData) {
>+      let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
>+      let doc = win.document;
>+      let richlistbox = doc.getElementById("downloadView");
>+      let searchbox = doc.getElementById("searchbox");
>+
>+      switch(testPhase++) {
>+        case 0:
>+          for(let i = 0; i < DownloadData.length - 1; i++) {
>+            let richlistitem = richlistbox.children[1];
>+            dm.removeDownload(richlistitem.getAttribute("dlid"));
>+          }
>+
>+          searchbox.value="two";
nit: spaces around = please

>+          searchbox.doCommand();
>+
>+          break;
>+        case 1:
>+          ok(richlistbox.itemCount == 0, "No downloads listed for entering a removed " +
>+            "downloads name as the search string");
Just put the sting on it's own line (next line)

>+
>+          searchbox.value="three";
nit: spaces around =

>+          searchbox.doCommand();
>+
>+          break;
>+        case 2:
>+          ok(richlistbox.itemCount == 0, "No downloads listed for entering a removed " +
>+            "downloads name as the search string");
ditto

>+
>+          searchbox.value="one";
ditto

r=sdwilsh with those fixed
Attachment #331492 - Flags: review?(sdwilsh) → review+
You need to log in before you can comment on or make changes to this bug.