Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330583

Summary: [client] enable testing of asynchronous javascript events
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tbuschto
Version: 1.4   
Target Milestone: 1.4 M4   
Hardware: All   
OS: All   
Whiteboard:

Description Tim Buschtoens CLA 2010-11-18 11:34:03 EST
A major restriction of our javascript testrunner is that whenver a delayed dom-event (not created by our fixture) is supposed to be fired, it is blocked by the runnig javascript thread. This means its impossible to capture it (and test its results), even if one would try to program the test-function to wait for it.

This especially concerns timer and load event. While the timer-events can be easily be faked, testing of iframe content is currently impossible, which is very troubling regarding the Browser-widget.

This could be solved using a timer to pause javascript execution for a while, but the testrunner would have to be prevented from continuing the tests during the pause.
Comment 1 Tim Buschtoens CLA 2010-11-23 08:16:30 EST
Fixed in CVS HEAD.

Changes include:

- Multi-Part-Tests: Instead of a test-function, define an array of functions. These are (as opposed to other test-functions of the same class) guarenteed to be called in the given order.

- New "store"-function in TestUtil: All given values are used as arguments for the next test-function, thereby allowing objected to be passed on over several parts of a test.

- New "delayTest"-function in TestUtil: Delays the executen of the next function by the given amount of ms.

- Adapted existing Browser-test: The BrowserTest.js has been changed to use these new features.