Closed Bug 553248 Opened 14 years ago Closed 14 years ago

waitForFocus in browser chrome tests uses SimpleTest ok(), rather than browser-test one.

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.3a4

People

(Reporter: mak, Assigned: mak)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

We should override it, to do so it should avoid using the global var, as other utils in that file.
Attached patch patch v1.0 (obsolete) — Splinter Review
Attachment #433301 - Flags: review?(enndeakin)
Attachment #433301 - Flags: feedback?
Attachment #433301 - Attachment is patch: true
Attachment #433301 - Attachment mime type: application/octet-stream → text/plain
Attachment #433301 - Flags: feedback? → feedback?(dao)
i tested this with a b-c test, and now waitForFocus really logs information.
Ideally they should be looged to an info() but simpleTest does not have such a thing.
Comment on attachment 433301 [details] [diff] [review]
patch v1.0

Looks ok to me, assuming it works.

>+    // Override SimpleTest methods with our own.
>+    ["ok", "is", "isnot", "todo", "todo_is", "todo_isnot"].forEach(function(m) {
>+      this.currentTest.scope.SimpleTest[m] = this.currentTest.scope[m];
>+    }, this);

How about:

    ...
      this.SimpleTest[m] = this[m];
    }, this.currentTest.scope);
Attachment #433301 - Flags: feedback?(dao) → feedback+
well it works, at least in the b-c test i built to check that i was getting TEST-PASS: waiting for focus and so on.

about the code change, nice trick, will do.
Attachment #433301 - Flags: review?(enndeakin) → review+
Summary: WaitForFocus uses the global SimpleTest scope ok, rather than our own → WaitForFocus uses the global SimpleTest scope ok(), rather than our own
Attached patch patch v1.1Splinter Review
added dao's suggestion. thanks.
Attachment #433301 - Attachment is obsolete: true
Summary: WaitForFocus uses the global SimpleTest scope ok(), rather than our own → waitForFocus in browser chrome tests uses SimpleTest ok(), rather than browser-test one.
http://hg.mozilla.org/mozilla-central/rev/bdb90006f262

so, i hope this can help figuring out remaining waitForFocus hangs.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a4
Component: BrowserTest → Mochitest
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: