[Webkit-unassigned] [Bug 60881] [Qt] Inspector may close at the start of the next inspector test in DRT

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 22 05:28:57 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=60881





--- Comment #21 from Zoltan Herczeg <zherczeg at webkit.org>  2011-06-22 05:28:56 PST ---
Finally, I solved this stupid bug. Heh, it nearly turned out to be the first bug that I cannot solve, but it isn't.

Here is the culprit:

inspector.js

var messagesToDispatch = [];

WebInspector.dispatch = function(message) {
    messagesToDispatch.push(message);
    setTimeout(function() {
        InspectorBackend.dispatch(messagesToDispatch.shift());
    }, 0);
}

"messagesToDispatch" is basically a FIFO queue, which means the messages are processed in order, regardless of how the unnamed sub-function is called. Naturally, the lastly appended message in this queue is the closeWebInspector for each test case. However, depending on the test case the setTimeout depth can be increased to 5 to some messages, which increases the minimum timeout to 10 ms to that particular call. This call may be processed after(!) the next test is started, which means the last item in the queue is processed there.

Possible fix: check messagesToDispatch.length() == 0 before reporting the test case finish.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list