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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html

Issue 2003433004: Remove dependency from ConsoleMessage to workers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1999463002
Patch Set: messageN Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/resources/worker-console-worker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
index 2d1a92aec34b7090d01ec80e8c84fbbf7ca752f8..1a9533ddc67a16f246b6b4663274f43f8b8ddce7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
@@ -275,6 +275,30 @@ InspectorTest.evaluateInPage = function(string, callback)
});
};
+InspectorTest._asyncCallbacks = {};
+InspectorTest._asyncCallbackId = 0;
+
+InspectorTest.evaluateInPageAsync = function(string, callback)
+{
+ var id = ++InspectorTest._asyncCallbackId;
+ InspectorTest._asyncCallbacks[id] = callback;
+ var callbackString = "testRunner.evaluateInWebInspector.bind(testRunner, 42, \"InspectorTest._evaluateInPageAsyncCompleted(" + id + ")\")";
+ var code = string.replace("%callback", callbackString);
+ InspectorTest.evaluateInPage(code);
+};
+
+InspectorTest._evaluateInPageAsyncCompleted = function(id)
+{
+ var callback = InspectorTest._asyncCallbacks[id];
+ delete InspectorTest._asyncCallbacks[id];
+ if (!callback) {
+ InspectorTest.log("Error: no callback for async function");
+ InspectorTest.completeTest();
+ return;
+ }
+ callback();
+}
+
InspectorTest.completeTestIfError = function(messageObject)
{
if (messageObject.error) {
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/resources/worker-console-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698