What's new? | Help | Directory | Sign in
Google
gears
Improving Your Web Browser
  
  
  
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
How to write tests:

Gears unit tests are contained in the files listed in the test/testcases/
directory. If you add a new file, you need to update test/testcases/config.js
to point to it.

The unit test runner can automatically run your tests in workers as well as
in the main HTML document. You should take advantage of this where possible.
To do so, just set the useWorker flag to true for your test file in config.js.

Unit tests have access to a variety of utility functions in test/tester/lang.js
and test/tester/assert.js.

The test runner also has support for asynchronous tests. To use it, set up your
test as usual in a test* function. After you start the asynchronous bit, call
startAsync(). When your asynchronous test completes successfully, call
completeAsync() to notify the test runner that the next test should begin.
Asynchronous tests that don't call completeAsync() are eventually timed out and
marked failed. For an example of asynchronous tests, see
testcases/timer_tests.js.

The test webserver binds itself to all bound IP addresses on the machine;
it is visible on 127.0.0.1 (localhost) as well as any other connected
interfaces.

How to run tests:

Run python test/runner/testwebserver.py
Then go to http://localhost:8001/tester/gui.html (or your favorite host name)
Show details Hide details

Change log

r1614 by gears.daemon on May 10, 2008   Diff
[Author: cprince]

Tweak test/README.txt to simplify
copy/pasting the URL.

PRESUBMIT=passed
R=michaeln
CC=google-gears-eng@googlegroups.com
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=7150215
SCL=7151713
Go to: 
Project members, sign in to write a code review

Older revisions

r700 by gears.daemon on Jan 16, 2008   Diff
[Author: gblock]

Gears  issue 346  covers problems with
the unit test server
not being available from an address
...
r648 by gears.daemon on Jan 04, 2008   Diff
[Author: aa]

g4 rename test2 test

Fixed all references to "test2". Allen
...
All revisions of this file

File info

Size: 1298 bytes, 29 lines