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

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

Issue 2234983002: [DevTools] Removed wasThrown from evaluate-like protocol methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 4 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
OLDNEW
1 if (window.GCController) 1 if (window.GCController)
2 GCController.collectAll(); 2 GCController.collectAll();
3 var initialize_InspectorTest = function() { 3 var initialize_InspectorTest = function() {
4 4
5 var results = []; 5 var results = [];
6 6
7 function consoleOutputHook(messageType) 7 function consoleOutputHook(messageType)
8 { 8 {
9 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1)); 9 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1));
10 } 10 }
(...skipping 25 matching lines...) Expand all
36 InspectorTest.flushResults = function() 36 InspectorTest.flushResults = function()
37 { 37 {
38 InspectorTest.RuntimeAgent.evaluate("flushResults(\"" + escape(JSON.stringif y(results)) + "\")", "test"); 38 InspectorTest.RuntimeAgent.evaluate("flushResults(\"" + escape(JSON.stringif y(results)) + "\")", "test");
39 results = []; 39 results = [];
40 } 40 }
41 41
42 InspectorTest.evaluateInPage = function(code, callback) 42 InspectorTest.evaluateInPage = function(code, callback)
43 { 43 {
44 callback = InspectorTest.safeWrap(callback); 44 callback = InspectorTest.safeWrap(callback);
45 45
46 function mycallback(error, result, wasThrown) 46 function mycallback(error, result, exceptionDetails)
47 { 47 {
48 if (!error) 48 if (!error)
49 callback(InspectorTest.runtimeModel.createRemoteObject(result), wasT hrown); 49 callback(InspectorTest.runtimeModel.createRemoteObject(result), exce ptionDetails);
50 } 50 }
51 InspectorTest.RuntimeAgent.evaluate(code, "console", false, mycallback); 51 InspectorTest.RuntimeAgent.evaluate(code, "console", false, mycallback);
52 } 52 }
53 53
54 InspectorTest.evaluateInPagePromise = function(code) 54 InspectorTest.evaluateInPagePromise = function(code)
55 { 55 {
56 return new Promise(succ => InspectorTest.evaluateInPage(code, succ)); 56 return new Promise(succ => InspectorTest.evaluateInPage(code, succ));
57 } 57 }
58 58
59 InspectorTest.evaluateInPageAsync = function(code) 59 InspectorTest.evaluateInPageAsync = function(code)
60 { 60 {
61 var callback; 61 var callback;
62 var promise = new Promise((fulfill) => { callback = fulfill }); 62 var promise = new Promise((fulfill) => { callback = fulfill });
63 InspectorTest.RuntimeAgent.evaluate(code, 63 InspectorTest.RuntimeAgent.evaluate(code,
64 "console", 64 "console",
65 /* includeCommandLineAPI */ false, 65 /* includeCommandLineAPI */ false,
66 /* doNotPauseOnExceptionsAndMuteConsole */ undefined, 66 /* doNotPauseOnExceptionsAndMuteConsole */ undefined,
67 /* contextId */ undefined, 67 /* contextId */ undefined,
68 /* returnByValue */ undefined, 68 /* returnByValue */ undefined,
69 /* generatePreview */ undefined, 69 /* generatePreview */ undefined,
70 /* userGesture */ undefined, 70 /* userGesture */ undefined,
71 /* awaitPromise */ true, 71 /* awaitPromise */ true,
72 mycallback); 72 mycallback);
73 73
74 function mycallback(error, result, wasThrown, exceptionDetails) 74 function mycallback(error, result, exceptionDetails)
75 { 75 {
76 if (!error && !wasThrown) { 76 if (!error && !exceptionDetails) {
77 callback(InspectorTest.runtimeModel.createRemoteObject(result)); 77 callback(InspectorTest.runtimeModel.createRemoteObject(result));
78 } else { 78 } else {
79 if (error) 79 if (error)
80 InspectorTest.addResult("Error: " + error); 80 InspectorTest.addResult("Error: " + error);
81 else 81 else
82 InspectorTest.addResult("Error: " + (exceptionDetails ? exceptio nDetails.text : " exception while evaluation in page.")); 82 InspectorTest.addResult("Error: " + (exceptionDetails ? exceptio nDetails.text : " exception while evaluation in page."));
83 InspectorTest.completeTest(); 83 InspectorTest.completeTest();
84 } 84 }
85 } 85 }
86 return promise; 86 return promise;
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 _output("[page] " + text); 1195 _output("[page] " + text);
1196 } 1196 }
1197 1197
1198 function _output(result) 1198 function _output(result)
1199 { 1199 {
1200 if (!outputElement) 1200 if (!outputElement)
1201 createOutputElement(); 1201 createOutputElement();
1202 outputElement.appendChild(document.createTextNode(result)); 1202 outputElement.appendChild(document.createTextNode(result));
1203 outputElement.appendChild(document.createElement("br")); 1203 outputElement.appendChild(document.createElement("br"));
1204 } 1204 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698