From fb630c1cdb74e955d343272a1c9b6ac2968e3a0c Mon Sep 17 00:00:00 2001 From: "mnaganov@chromium.org" Date: Tue, 8 Sep 2009 10:50:56 +0000 Subject: DevTools: fix flakiness of DevToolsSanityTest/TestProfilerTab. Made a local run for 25 times, got no single failure. BUG=http://crbug.com/21108 TEST=none Review URL: http://codereview.chromium.org/200040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25614 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/devtools/js/tests.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'webkit') diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js index 41141fc..5691017 100644 --- a/webkit/glue/devtools/js/tests.js +++ b/webkit/glue/devtools/js/tests.js @@ -320,7 +320,7 @@ TestSuite.prototype.testProfilerTab = function() { // that is called 'fib' or 'eternal_fib'. If found, it will mean // that we actually have profiled page's code. while (node) { - if (node.functionName.indexOf("fib") != -1) { + if (node.functionName.indexOf('fib') != -1) { test.releaseControl(); } node = node.traverseNextNode(true, null, true); @@ -328,9 +328,21 @@ TestSuite.prototype.testProfilerTab = function() { test.fail(); }); + var ticksCount = 0; + var tickRecord = '\nt,'; + this.addSniffer(RemoteDebuggerAgent, 'DidGetNextLogLines', + function(log) { + var pos = 0; + while ((pos = log.indexOf(tickRecord, pos)) != -1) { + pos += tickRecord.length; + ticksCount++; + } + if (ticksCount > 100) { + InspectorController.stopProfiling(); + } + }, true); InspectorController.startProfiling(); - window.setTimeout('InspectorController.stopProfiling();', 1000); this.takeControl(); }; -- cgit v1.1