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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright (C) 2012 Samsung Electronics. All rights reserved. 2 Copyright (C) 2012 Samsung Electronics. All rights reserved.
3 3
4 Redistribution and use in source and binary forms, with or without 4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions 5 modification, are permitted provided that the following conditions
6 are met: 6 are met:
7 7
8 1. Redistributions of source code must retain the above copyright 8 1. Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer. 9 notice, this list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright 10 2. Redistributions in binary form must reproduce the above copyright
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 InspectorTest.evaluateInPage = function(string, callback) 268 InspectorTest.evaluateInPage = function(string, callback)
269 { 269 {
270 this.sendCommand("Runtime.evaluate", { "expression": string }, function(mess age) { 270 this.sendCommand("Runtime.evaluate", { "expression": string }, function(mess age) {
271 if (message.error) 271 if (message.error)
272 InspectorTest.log("Error while executing '" + string + "': " + messa ge.error.message); 272 InspectorTest.log("Error while executing '" + string + "': " + messa ge.error.message);
273 else if (callback) 273 else if (callback)
274 callback(message.result.result.value); 274 callback(message.result.result.value);
275 }); 275 });
276 }; 276 };
277 277
278 InspectorTest._asyncCallbacks = {};
279 InspectorTest._asyncCallbackId = 0;
280
281 InspectorTest.evaluateInPageAsync = function(string, callback)
282 {
283 var id = ++InspectorTest._asyncCallbackId;
284 InspectorTest._asyncCallbacks[id] = callback;
285 var callbackString = "testRunner.evaluateInWebInspector.bind(testRunner, 42, \"InspectorTest._evaluateInPageAsyncCompleted(" + id + ")\")";
286 var code = string.replace("%callback", callbackString);
287 InspectorTest.evaluateInPage(code);
288 };
289
290 InspectorTest._evaluateInPageAsyncCompleted = function(id)
291 {
292 var callback = InspectorTest._asyncCallbacks[id];
293 delete InspectorTest._asyncCallbacks[id];
294 if (!callback) {
295 InspectorTest.log("Error: no callback for async function");
296 InspectorTest.completeTest();
297 return;
298 }
299 callback();
300 }
301
278 InspectorTest.completeTestIfError = function(messageObject) 302 InspectorTest.completeTestIfError = function(messageObject)
279 { 303 {
280 if (messageObject.error) { 304 if (messageObject.error) {
281 InspectorTest.log(messageObject.error.message); 305 InspectorTest.log(messageObject.error.message);
282 InspectorTest.completeTest(); 306 InspectorTest.completeTest();
283 return true; 307 return true;
284 } 308 }
285 return false; 309 return false;
286 } 310 }
287 311
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 var callback = didResolve ? callbacks.resolve : callbacks.reject; 422 var callback = didResolve ? callbacks.resolve : callbacks.reject;
399 delete pendingPromiseEvalRequests[callId]; 423 delete pendingPromiseEvalRequests[callId];
400 callback(value); 424 callback(value);
401 } 425 }
402 426
403 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest), false); 427 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest), false);
404 428
405 </script> 429 </script>
406 </head> 430 </head>
407 </html> 431 </html>
OLDNEW
« 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