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

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

Issue 2182373002: DevTools: fix inspector/elements/css-rule-hover-highlights-selectors.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lastEvalId Created 4 years, 5 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: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
index f0f43e8741bb2751b4797be2282183c70b6c7887..e58dab874c10c11dd0ed6d9a884eb9e17b59fd06 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -74,7 +74,36 @@ InspectorTest.evaluateFunctionInOverlay = function(func, callback)
}
}
+InspectorTest.waitForOverlayRepaint = function(callback)
+{
+ InspectorTest.evaluateInPageAsync("requestAnimationFrame(%callback)", callback);
caseq 2016/07/27 00:48:25 Rather than using rAF, you probably want testRunne
lushnikov 2016/07/27 03:14:46 I'm not sure if the layoutAndPaintAsyncThen will f
+}
+
+
var lastEvalId = 0;
+var asyncCallbacks = {};
+
+InspectorTest.evaluateInPageAsync = function(string, callback)
caseq 2016/07/27 00:48:25 Please don't. See invokeInPageAsync: https://cs.ch
lushnikov 2016/07/27 03:14:46 Beautiful. Thank you!
+{
+ var id = ++lastEvalId;
+ asyncCallbacks[id] = callback;
+ var callbackString = `testRunner.evaluateInWebInspector.bind(testRunner, ${id}, "InspectorTest._evaluateInPageAsyncCompleted(${id})")`;
+ var code = string.replace("%callback", callbackString);
+ InspectorTest.evaluateInPage(code);
+};
+
+InspectorTest._evaluateInPageAsyncCompleted = function(id)
+{
+ var callback = asyncCallbacks[id];
+ delete asyncCallbacks[id];
+ if (!callback) {
+ InspectorTest.log("Error: no callback for async function");
+ InspectorTest.completeTest();
+ return;
+ }
+ callback();
+}
+
var pendingEvalRequests = {};
var lastPromiseEvalId = 0;

Powered by Google App Engine
This is Rietveld 408576698