Changes between Version 6 and Version 7 of Writing Layout Tests to test iOS UI features
- Timestamp:
- Sep 30, 2015 3:44:36 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Layout Tests to test iOS UI features
v6 v7 106 106 }}} 107 107 108 Note that this console.log() won't show in layout test output, since it's being generated in the UI process (but it will be logged if you run webkittestrunner directly, which is useful for debugging).108 Note that this console.log() won't show in layout test output, since it's being generated in the UI process (but it will be logged if you run WebkitTestRunner directly, which is useful for debugging). 109 109 110 110 However, the web process needs to be told that the UI script is complete, so when your test has finished doing work in the UI process, it should call uiScriptComplete(), passing the result: … … 118 118 }}} 119 119 120 There are some callbacks you can register on UIScriptController to get notified when certain things happen, like zooming. These are useful because event dispatch doesn't imply that zooming is done, since the zoom is animated. So in the above example, we don't have the final zoom scale when calling uiScriptComplete(). We really have to wait for the zoom to finish: 120 121 122 {{{ 123 (function() { 124 uiController.didEndZoomingCallback = function() { 125 uiController.uiScriptComplete('Zoomed to scale ' + uiController.zoomScale); 126 }; 127 128 uiController.doubleTapAtPoint(50, 50, function() { /* Do nothing here */ }); 129 })(); 130 }}} 131 132 You can chain as many asynchronous things as you like in the UI-side script, as long as you call uiScriptComplete() when the chain is complete. You can also call testRunner.runUIScript() as many times as you like from the test content, making it possible to test a long sequence of operations that bounce between the UI process and the web process. 133 134