summaryrefslogtreecommitdiffstats
path: root/tools/gypv8sh.py
diff options
context:
space:
mode:
authorscr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-05 04:24:20 +0000
committerscr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-05 04:24:20 +0000
commit26d47586aab3b841a1ecbe7bdfcabb86f5243ff2 (patch)
tree7b90a780e71bcdd8ea5bcd4671952972e4424a0d /tools/gypv8sh.py
parentd15c370b5043f7959e05fe6be68599093d1554fd (diff)
downloadchromium_src-26d47586aab3b841a1ecbe7bdfcabb86f5243ff2.zip
chromium_src-26d47586aab3b841a1ecbe7bdfcabb86f5243ff2.tar.gz
chromium_src-26d47586aab3b841a1ecbe7bdfcabb86f5243ff2.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.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=108391 Review URL: http://codereview.chromium.org/8418015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gypv8sh.py')
-rw-r--r--tools/gypv8sh.py12
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: