Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Unified Diff: webkit/glue/devtools/js/tests.js

Issue 200040: DevTools: fix flakiness of DevToolsSanityTest/TestProfilerTab. (Closed)
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/devtools/js/tests.js
diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js
index 41141fcf55f00fb06d9ba364f7cc4d1e686ff187..569101722ef5f064a43e17902b5a14b9b271c918 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();
};
« chrome/test/data/devtools/js_page.html ('K') | « chrome/test/data/devtools/js_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698