browser chrome MochiTest harness doesn't define todo_is and todo_isnot

RESOLVED FIXED

Status

Testing
BrowserTest
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: myk, Assigned: myk)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

10 years ago
Created attachment 298370 [details] [diff] [review]
patch v1: adds todo_is, todo_isnot functions

The MochiTest docs <http://developer.mozilla.org/en/docs/Mochitest#Writing_new_Mochitest_tests> say you can use six functions in inline test scripts: ok, is, isnot, todo, todo_is, todo_isnot, but the last two are not defined by the browser chrome test harness.

Here are implementations of those functions for that harness.
Attachment #298370 - Flags: review?(gavin.sharp)
Comment on attachment 298370 [details] [diff] [review]
patch v1: adds todo_is, todo_isnot functions

Please add tests for this to browser_fail.js and browser_pass.js in testing/mochitest/tests/browser  . browser_fail.js is disabled by default (because it fails, obviously), so you'll need to enable it in the Makefile if you want to test.
Attachment #298370 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 2

10 years ago
Created attachment 298529 [details] [diff] [review]
patch v2: adds tests for new functionality.

(In reply to comment #1)
> (From update of attachment 298370 [details] [diff] [review])
> Please add tests for this to browser_fail.js and browser_pass.js in
> testing/mochitest/tests/browser

Here's a version of the patch with tests added to browser_fail.js and browser_pass.js.  I uncommented browser_fail.js in the Makefile temporarily and tested to make sure it worked.

This is almost the version of the patch I'll check in.  I'll just wait until Gavin checks in his fix for bug 413418 and then resolve conflicts between that patch and this one.
Attachment #298370 - Attachment is obsolete: true
(Assignee)

Comment 3

10 years ago
Created attachment 299278 [details] [diff] [review]
patch v3: resolves conflicts with bug 413418

This patch is identical to patch v2 but resolves conflicts with the checkin for bug 413416.  This is the version of the patch I'll check in.

Requesting approval1.9 for this low-risk test harness fix that adds the two functions todo_is and todo_isnot to the browser chrome test harness (the content and chrome test harnesses already have these functions).  The patch also adds tests that test these functions to make sure they work correctly.
Attachment #298529 - Attachment is obsolete: true
(Assignee)

Comment 4

10 years ago
Comment on attachment 299278 [details] [diff] [review]
patch v3: resolves conflicts with bug 413418

Requesting approval1.9 for this low-risk test harness fix that adds the two
functions todo_is and todo_isnot to the browser chrome test harness (the
content and chrome test harnesses already have these functions).  The patch
also adds tests that test these functions to make sure they work correctly.
Attachment #299278 - Flags: approval1.9?
Comment on attachment 299278 [details] [diff] [review]
patch v3: resolves conflicts with bug 413418

a=beltzner yay tests!
Attachment #299278 - Flags: approval1.9? → approval1.9+
(Assignee)

Comment 6

10 years ago
Checking in testing/mochitest/browser-test.js;
/cvsroot/mozilla/testing/mochitest/browser-test.js,v  <--  browser-test.js
new revision: 1.5; previous revision: 1.4
done
Checking in testing/mochitest/tests/browser/browser_pass.js;
/cvsroot/mozilla/testing/mochitest/tests/browser/browser_pass.js,v  <--  browser_pass.js
new revision: 1.3; previous revision: 1.2
done
Checking in testing/mochitest/tests/browser/browser_fail.js;
/cvsroot/mozilla/testing/mochitest/tests/browser/browser_fail.js,v  <--  browser_fail.js
new revision: 1.2; previous revision: 1.1
done
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Component: Testing → BrowserTest
Product: Core → Testing
QA Contact: testing → browsertest
You need to log in before you can comment on or make changes to this bug.