goog.testing.TestCase | |
goog.testing.AsyncTestCase | goog.testing.TestCase |
goog.testing.DeferredTestCase | goog.testing.AsyncTestCase |
opt_name
: string=
A descriptive name for the test case.
|
![]()
Calls the given function, redirecting any exceptions to doAsyncError.
Arguments:
Returns: !goog.testing.AsyncTestCase.TopStackFuncResult_
Returns a
TopStackFuncResult_.
|
code » | |||
![]()
Continue with the next step in the test cycle.
|
code » | |||
![]()
Starts the tests.
|
code » | |||
![]()
Logs the given debug message to the console (when enabled).
Arguments:
|
code » | |||
![]()
Handles an exception thrown by a test.
Arguments:
|
code » | |||
![]()
Calls the tearDown function, catching any errors, and then moves on to
the next step in the testing cycle.
|
code » | |||
![]()
Step 3: Call test.execute().
|
code » | |||
![]()
Step 1: Move to the next test.
|
code » | |||
![]()
Step 5: Call doSuccess()
|
code » | |||
![]()
Sets up the test page and then waits untill the test case has been marked
as ready before executing the tests.
|
code » | |||
![]()
Step 2: Call setUp().
|
code » | |||
![]()
Step 4: Call tearDown().
|
code » | |||
![]()
Wraps doAsyncError() for when we are sure that the test runner has no user
code above it in the stack.
Arguments:
|
code » | |||
![]()
Enables verbose logging of what is happening inside of the AsyncTestCase.
|
code » | |||
![]()
Ends the current test step and queues the next test step to run.
|
code » | |||
![]()
Finalizes the test case, called when the tests have finished executing.
|
code » | |||
The current step name.
Returns: !string
Step name.
|
code » | |||
![]()
Replaces the asserts.js assert_() and fail() functions with a wrappers to
catch the exceptions.
|
code » | |||
![]()
Sets a window.onerror handler for catching exceptions that happen in async
callbacks. Note that as of Safari 3.1, Safari does not support this.
|
code » | |||
![]()
Calls the next callback when the isReady_ flag is true.
Arguments:
|
code » | |||
![]()
Sets up the test page and then waits until the test case has been marked
as ready before executing the tests.
|
code » | |||
![]()
Sets the next function to call in our sequence of async callbacks.
|
code » | |||
![]()
Signals once to continue with the test. If this is the last signal that the
test was waiting on, call continueTesting.
|
code » | |||
![]()
Enables the timeout timer. This timer fires unless continueTesting is
called.
|
code » | |||
![]()
Disables the timeout timer.
|
code » | |||
![]()
Unhooks window.onerror and _assert.
|
code » | |||
![]()
Informs the testcase not to continue to the next step in the test cycle
until continueTesting is called.
Arguments:
|
code » | |||
![]()
Informs the testcase not to continue to the next step in the test cycle
until signal is called the specified number of times. Within a test, this
function behaves additively if called multiple times; the number of signals
to wait for will be the sum of all expected number of signals this function
was called with.
Arguments:
|
code » |
![]()
Adds a new test to the test case.
Arguments:
|
code » | |||
![]()
Creates and adds a new test.
Convenience function to make syntax less awkward when not using automatic
test discovery.
|
code » | |||
![]()
Adds any functions defined in the global scope that correspond to
lifecycle events for the test case. Overrides setUp, tearDown, setUpPage,
tearDownPage and runTests if they are defined.
|
code » | |||
![]()
Adds any functions defined in the global scope that are prefixed with "test"
to the test case.
|
code » | |||
![]()
Clears a timeout created by
this.timeout() .
Arguments:
|
code » | |||
Counts the number of files that were loaded for dependencies that are
required to run the test.
Returns: number
The number of files loaded.
|
code » | |||
Creates a
goog.testing.TestCase.Test from an auto-discovered
function.
Arguments:
Returns: !goog.testing.TestCase.Test
The newly created test.
|
code » | |||
![]()
Cycles through the tests, breaking out using a setTimeout if the execution
time has execeeded
#maxRunTime .
|
code » | |||
![]()
Handles a test that failed.
Arguments:
|
code » | |||
![]()
Handles a test that passed.
Arguments:
|
code » | |||
![]()
Executes each of the tests.
|
code » | |||
![]()
Finalizes the test case, called when the tests have finished executing.
|
code » | |||
Returns the number of tests actually run in the test case, i.e. subtracting
any which are skipped.
Returns: number
The number of un-ignored tests.
|
code » | |||
No description.
Returns: string
The function name prefix used to auto-discover tests.
|
code » | |||
No description.
Returns: number
Time since the last batch of tests was started.
|
code » | |||
Returns the number of tests contained in the test case.
Returns: number
The number of tests.
|
code » | |||
Gets the object with all globals.
Arguments:
Returns: Object
An object with all globals starting with the prefix.
|
code » | |||
No description.
Returns: string
The name of the test.
|
code » | |||
Returns the number of script files that were loaded in order to run the test.
Returns: number
The number of script files.
|
code » | |||
Returns a string detailing the results from the test.
Arguments:
Returns: string
The results from the test.
|
code » | |||
Returns the amount of time it took for the test to run.
Returns: number
The run time, in milliseconds.
|
code » | |||
Returns the test results object: a map from test names to a list of test
failures (if any exist).
|
code » | |||
Gets the tests.
|
code » | |||
Returns the current time.
Returns: string
HH:MM:SS.
|
code » | |||
No description.
Returns: boolean
Whether the test case is running inside the multi test
runner.
|
code » | |||
No description.
Returns: boolean
Whether the test was a success.
|
code » | |||
![]()
Logs an object to the console, if available.
Arguments:
|
code » | |||
No description.
Arguments:
Returns: !goog.testing.TestCase.Error
Error object.
|
code » | |||
Checks to see if the test should be marked as failed before it is run.
If there was an error in setUpPage, we treat that as a failure for all tests
and mark them all as having failed.
Arguments:
Returns: boolean
Whether the test was marked as failed.
|
code » | |||
Returns the current test and increments the pointer.
Returns: goog.testing.TestCase.Test
The current test case.
|
code » | |||
No description.
Returns: number
The current time in milliseconds, don't use goog.now as some
tests override it.
|
code » | |||
![]()
Reorders the tests depending on the
order field.
Arguments:
|
code » | |||
Pads a number to make it have a leading zero if it's less than 10.
|
code » | |||
![]()
Resets the test case pointer, so that next returns the first test.
|
code » | |||
![]()
Executes each of the tests.
Overridable by the individual test case. This allows test cases to defer
when the test is actually started. If overridden, finalize must be called
by the test to indicate it has finished.
|
code » | |||
![]()
Saves a message to the result set.
Arguments:
|
code » | |||
![]()
No description.
Arguments:
|
code » | |||
![]()
Sets the callback function that should be executed when the tests have
completed.
Arguments:
|
code » | |||
![]()
Sets the tests.
Arguments:
|
code » | |||
![]()
Gets called before every goog.testing.TestCase.Test is been executed. Can be
overridden to add set up functionality to each test.
|
code » | |||
![]()
Gets called before any tests are executed. Can be overridden to set up the
environment for the whole test case.
|
code » | |||
Can be overridden in test classes to indicate whether the tests in a case
should be run in that particular situation. For example, this could be used
to stop tests running in a particular browser, where browser support for
the class under test was absent.
Returns: boolean
Whether any of the tests in the case should be run.
|
code » | |||
![]()
Gets called after every goog.testing.TestCase.Test has been executed. Can be
overriden to add tear down functionality to each test.
|
code » | |||
![]()
Gets called after all tests have been executed. Can be overridden to tear
down the entire test case.
|
code » | |||
Calls a function after a delay, using the protected timeout.
|
code » | |||
Trims a path to be only that after google3.
|
code » |
The currently active test.
|
Code » | |
![]()
Marks if the cleanUp() function has been called for the currently running
test.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
The stage of the test we are currently on.
|
Code » | |
![]()
The name of the stage of the test we are currently on.
|
Code » | |
![]()
Turn on extra logging to help debug failing async. tests.
|
Code » | |
![]()
Number of signals to wait for before continuing testing when waitForSignals
is used.
|
Code » | |
![]()
A flag to prevent recursive exception handling.
|
Code » | |
![]()
Flag used to determine if we can move to the next step in the testing loop.
|
Code » | |
![]()
The stage of the test we should run next.
|
Code » | |
![]()
The name of the stage of the test we should run next.
|
Code » | |
![]()
The number of times we have thrown a ControlBreakingException so that we
know not to complain in our window.onerror handler. In Webkit, window.onerror
is not supported, and so this counter will keep going up but we won't care
about it.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
A reference to the original window.onerror function.
|
Code » | |
![]()
Number of signals received.
|
Code » | |
![]()
Flag that tells us if there is a function in the call stack that will make
a call to pump_().
|
Code » | |
![]()
How long to wait for a single step of a test to complete in milliseconds.
A step starts when a call to waitForAsync() is made.
|
Code » | |
![]()
How long to wait after a failed test before moving onto the next one.
The purpose of this is to allow any pending async callbacks from the failing
test to finish up and not cause the next test to fail.
|
Code » | |
![]()
The handle to the current setTimeout timer.
|
Code » |
![]()
Time since the last batch of tests was started, if batchTime exceeds
#maxRunTime a timeout will be used to stop the tests blocking the
browser and a new batch will be started.
|
Code » | |
![]()
Pointer to the current test.
|
Code » | |
![]()
Exception object that was detected before a test runs.
|
Code » | |
![]()
A name for the test case.
|
Code » | |
![]()
Optional callback that will be executed when the test has finalized.
|
Code » | |
![]()
The order to run the auto-discovered tests in.
|
Code » | |
Object used to encapsulate the test results.
|
Code » | |
![]()
Whether the test case is running.
|
Code » | |
![]()
Timestamp for when the test was started.
|
Code » | |
![]()
Whether the test case has ever tried to execute.
|
Code » | |
![]()
Set of test names and/or indices to execute, or null if all tests should
be executed.
Indices are included to allow automation tools to run a subset of the
tests without knowing the exact contents of the test file.
Indices should only be used with SORTED ordering.
Example valid values:
|
Code » | |
![]()
Array of test functions that can be executed.
|
Code » |
Preferred way of creating an AsyncTestCase. Creates one and initializes it
with the G_testRunner.
Arguments:
Returns: !goog.testing.AsyncTestCase
The created AsyncTestCase.
|
code » |
![]()
Represents result of top stack function call.
|
Code » | |
![]()
No description.
|
Code » |