diff options
author | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 01:25:29 +0000 |
---|---|---|
committer | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 01:25:29 +0000 |
commit | 369d25ca02211727361c11af0b8e8db2b234d421 (patch) | |
tree | 0d21be7adaca018c56a0728eb5a790f109e2ca1c /tools/gypv8sh.py | |
parent | 1e29b4e78e03e519bf8e79160d827c22a0c39de0 (diff) | |
download | chromium_src-369d25ca02211727361c11af0b8e8db2b234d421.zip chromium_src-369d25ca02211727361c11af0b8e8db2b234d421.tar.gz chromium_src-369d25ca02211727361c11af0b8e8db2b234d421.tar.bz2 |
Allow javascript unit tests using webui test_api framework.
I moved javascript2webui.js over to chrome/test/base/js2gtest.js and shared it
across webui and unit tests with an extra parameter for test type, which governs
the few differences, such as what to include/subclass from and the flavor of
gtest (TEST_F v. IN_PROC_BROWSER_TEST_F).
v8_unit_test implemented 2 main methods to make it work with the generated C++
- AddLibrary - loads the file in the test context
- RunJavascriptF - launches the runTest with the testFixture and testName,
coordinating with Error and ChromeSend to report results.
Helper functions:
- Error - watches for console.error, noting failure if seen.
- ChromeSend - pulls apart the result from the test_api's call to
chrome.send('testResult', [ok, msg])
R=arv@chromium.org
BUG=87820
TEST=unit_tests --gtest_filter=FrameworkUnitTest.*
Review URL: http://codereview.chromium.org/8418015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gypv8sh.py')
-rw-r--r-- | tools/gypv8sh.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/gypv8sh.py b/tools/gypv8sh.py index ca9c759..7018db9 100644 --- a/tools/gypv8sh.py +++ b/tools/gypv8sh.py @@ -24,18 +24,18 @@ import shutil def main (): parser = optparse.OptionParser() parser.set_usage( - "%prog v8_shell mock.js test_api.js js2webui.js inputfile inputrelfile " - "cxxoutfile jsoutfile") + "%prog v8_shell mock.js test_api.js js2webui.js " + "testtype inputfile inputrelfile cxxoutfile jsoutfile") parser.add_option('-v', '--verbose', action='store_true') parser.add_option('-n', '--impotent', action='store_true', help="don't execute; just print (as if verbose)") (opts, args) = parser.parse_args() - if len(args) != 8: + if len(args) != 9: parser.error('all arguments are required.') - (v8_shell, mock_js, test_api, js2webui, inputfile, inputrelfile, - cxxoutfile, jsoutfile) = args - arguments = [js2webui, inputfile, inputrelfile, cxxoutfile] + (v8_shell, mock_js, test_api, js2webui, test_type, + inputfile, inputrelfile, cxxoutfile, jsoutfile) = args + arguments = [js2webui, inputfile, inputrelfile, cxxoutfile, test_type] cmd = [v8_shell, '-e', "arguments=" + json.dumps(arguments), mock_js, test_api, js2webui] if opts.verbose or opts.impotent: |