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

Unified Diff: LayoutTests/http/tests/inspector/inspector-test.js

Issue 615033002: Refactor of various layout tests to use RAF (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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: LayoutTests/http/tests/inspector/inspector-test.js
diff --git a/LayoutTests/http/tests/inspector/inspector-test.js b/LayoutTests/http/tests/inspector/inspector-test.js
index e8e53e0d20575ceab794a5ce7af0fa5969833c2c..956312dd65f87aa50b7f0bb3c0608e43e48e439a 100644
--- a/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/LayoutTests/http/tests/inspector/inspector-test.js
@@ -90,7 +90,7 @@ InspectorTest.evaluateInPage = function(code, callback)
InspectorTest.evaluateInPageWithTimeout = function(code)
{
- InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'))");
+ InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'), 1)");
}
var lastEvalId = 0;
@@ -514,7 +514,7 @@ InspectorTest.TempFileMock = function(dirPath, name, callback)
{
this._chunks = [];
this._name = name;
- setTimeout(callback.bind(this, this), 0);
+ requestAnimationFrame(callback.bind(this, this));
}
InspectorTest.TempFileMock.prototype = {
@@ -525,7 +525,7 @@ InspectorTest.TempFileMock.prototype = {
write: function(strings, callback)
{
this._chunks.push.apply(this._chunks, strings);
- setTimeout(callback.bind(this, true), 0);
+ requestAnimationFrame(callback.bind(this, true));
},
finishWriting: function() { },
@@ -663,17 +663,17 @@ function closeFrontend(callback)
{
// Do this asynchronously to allow InspectorBackendDispatcher to send response
// back to the frontend before it's destroyed.
- setTimeout(function() {
+ requestAnimationFrame(function() {
testRunner.closeWebInspector();
callback();
- }, 0);
+ });
}
function openFrontendAndIncrement()
{
frontendReopeningCount++;
testRunner.showWebInspector();
- setTimeout(runTest, 0);
+ requestAnimationFrame(runTest);
}
function runAfterIframeIsLoaded()
@@ -780,9 +780,9 @@ function closeInspectorAndNotifyDone()
clearTimeout(window._watchDogTimer);
testRunner.closeWebInspector();
- setTimeout(function() {
+ requestAnimationFrame(function() {
testRunner.notifyDone();
- }, 0);
+ });
}
var outputElement;

Powered by Google App Engine
This is Rietveld 408576698