DescriptionAdded options browser_tests using the generator and js handler framework.
This patch turned out to be fairly large. Let me describe the ultimate goal:
- To write WebUI tests in javascript, with as little C++ as possible for the simple case, yet powerful enough to support more complicated cases. options.js illustrates the simple case, and print_preview.js illustrates the complicated case.
Original changes:
- Refactored test_tab_strip_observer into test_navigation_observer so that it could be used by itself without needing the TabInsertedAt logic, which PrintPreview needs when there's no TabContentsWrapper available.
- Added assertEqualsArray for comparing two arrays shallowly (javascript == fails).
- Provided logic in WebUIBrowserTest and in the javascript2webui.js generation script to allow browsing to a url with preload of injected javascript.
- Corrected test_navigation_observer to wait for the right notification before calling callback (which runs after the page's javascript is loaded but before its onload).
- Added guts to define OS_* ifdefs for javascript to test for disabling tests.
- Moved the handler from settings_browsertest.cc to settings.js
- use __proto__ when overriding chrome to allow other members to be seen (commandLineString, e.g.)
Additions made during review:
- Switched to generative mechanism: TEST_F, GEN, which output during generation, and register during runtime.
- JS fixtures provide configuration members
- Add configuration hooks to generate in C++ test function
- Output directly to .cc file rather than needing hand-made .cc file which includes the generated file.
- Changed preload to take testFixture and testName.
- include and use mock4js to ensure handler methods are called.
- auto-generate the typedef WebUIBrowserTest testFixture unless overridden.
R=jhawkins@chromium.org,dtseng@chromium.org
BUG=82437
TEST=browser_tests --gtest_filter=SettingsWebUITest.*
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=92084
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=92111
Patch Set 1 #Patch Set 2 : Use __proto__ to get the old_chrome's methods when overriding. #Patch Set 3 : Remove unused headers. #Patch Set 4 : More unused headers. #Patch Set 5 : Fix OS_* insertions for javascript. #Patch Set 6 : Windows doesn't allow OVERRIDE on destructors. #
Total comments: 15
Patch Set 7 : s/settings/options/, moved .cc into options dir, addressed JS readability. #
Total comments: 41
Patch Set 8 : Mike's nits. #Patch Set 9 : Overhaul to TEST_F-style, ditch -inl.h, use mock4js. #Patch Set 10 : Added documentation for newly added classes. #
Total comments: 12
Patch Set 11 : Removing quotes from attributes. #Patch Set 12 : Fixed indentation and removed OVERRIDE from method definition. #Patch Set 13 : Fixed indentation on options.js array assignment; added LICENSE file. #Patch Set 14 : Use preamble to ditch awkward skipTest. Added typedef generation for simple C++ fixtures. #Patch Set 15 : Added basic includes for auto-generation (gurl, gtest). #Patch Set 16 : Full documentation, stuff testNames into testFixtures, handle no-preload case. #Patch Set 17 : rebase. #
Total comments: 10
Patch Set 18 : Change (!('foo' in bar)) to (bar['foo'] === undefined); remove includes. #Patch Set 19 : Fix indent & commenting capitalization. #
Total comments: 8
Patch Set 20 : TestNavigationController in ui_test_utils, renamed LoadStart->JsInjectionReady, reordered methods. #
Total comments: 8
Messages
Total messages: 19 (0 generated)
|