DescriptionAllow 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
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=108773
Patch Set 1 #Patch Set 2 : Fix windows file path to ascii conversion. #Patch Set 3 : AppendASCII #Patch Set 4 : Refactored to share the same generator js2gtest.js #Patch Set 5 : Cleanups and a few more tests. #Patch Set 6 : Also check for successful runTest. #Patch Set 7 : Don't double log errors (console.error). #
Total comments: 2
Patch Set 8 : Removed unnecessary parens. #
Total comments: 19
Patch Set 9 : Addressed James' review comments. #Patch Set 10 : Rebase. #
Total comments: 2
Patch Set 11 : Use MaybeAsASCII() to get file path as recommended by mark@. #
Total comments: 4
Patch Set 12 : Address wrapping and commenting nits. #Patch Set 13 : Added missing dependency on v8_shell. #
Total comments: 2
Patch Set 14 : Allow chrome.send to pass 1 arg, but check for "testResult". #
Messages
Total messages: 21 (0 generated)
|