test_ and must have the extension
Running the Tests
These tests are run using the Marionette Python testrunner; see Running Tests for more details.
finish() is called, the framework collects information about all the assertions made during the test and sends it to the Marionette test driver, which will report the results. For example:
// test logic (possibly asynchronous) goes here... finish();
For examples, see the tests under dom/telephony/tests/marionette.
||integer||The maximum number of seconds a test can wait for
||string||Either "content" or "chrome"; the context in which the test will be executed in. Defaults to "content".|
MARIONETTE_TIMEOUT = 30000; // 30s timeout MARIONETTE_CONTEXT = "chrome"; // execute test in chrome context // test logic (possibly asynchronous) goes here... finish();
is(value1, value2, message)
Asserts that two values are equivalent. A failure of an assertion will cause the test to fail with the given message.
isnot(value1, value2, message)
Asserts that two values are not equivalent. A failure of an assertion will cause the test to fail with the given message.
Asserts that a value is true. A failure of an assertion will cause the test to fail with the given message.
Ends the test.
Causes the specified message to be logged at the specified level. Levels are arbitrary strings; defaults to "INFO".
Returns all the logs so far as an array, and clears the log.
waitFor(callback, test, timeout)
Repeatedly calls the function passed as the
test parameter until that function returns true, then calls the
callback. If the
test function does not return true within
timeout ms, an exception is thrown. The
timeout parameter can be omitted, in which case a system default timeout is used.
Send the specified command string to the emulator's control port. The optional callback is invoked with an array containing the result lines of the command's output. Please refer to the Android Emulator documentation for the list of commands.