Experimental API: May be changed in next release and may not yet work perfectly!
This method blocks until all background JavaScript tasks scheduled to start executing before (now + delayMillis) have finished executing. Background JavaScript tasks are JavaScript tasks scheduled for execution via window.setTimeout, window.setInterval or asynchronous XMLHttpRequest.
If there is no background JavaScript task currently executing, and there is no background JavaScript task scheduled to start executing within the specified time, this method returns immediately -- even if there are tasks scheduled to be executed after (now + delayMillis).
Note that the total time spent executing a background JavaScript task is never known ahead of time, so this method makes no guarantees as to how long it will block.
Use this method instead of {@link #waitForBackgroundJavaScript(long)} if you know roughly whenyour background JavaScript is supposed to start executing, but you're not necessarily sure how long it will take to execute.
@param delayMillis the delay which determines the background tasks to wait for (in milliseconds)
@return the number of background JavaScript jobs still executing or waiting to be executed when thismethod returns; will be
0 if there are no jobs left to execute