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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-callFunctionOn-async.html

Issue 2214193002: [DevTools] Introduce unserializableValue in RemoteObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hidden 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 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 function test() 6 function test()
7 { 7 {
8 InspectorTest.runTestSuite([ 8 InspectorTest.runTestSuite([
9 function testArguments(next) 9 function testArguments(next)
10 { 10 {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 .then((result) => objectId = result.result.result.objectId) 106 .then((result) => objectId = result.result.result.objectId)
107 for (let argumentExpression of argumentExpressions) { 107 for (let argumentExpression of argumentExpressions) {
108 promise = promise 108 promise = promise
109 .then(() => InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: argumentExpression })) 109 .then(() => InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: argumentExpression }))
110 .then((result) => addArgument(result.result.result)); 110 .then((result) => addArgument(result.result.result));
111 } 111 }
112 return promise.then(() => InspectorTest.sendCommandPromise("Runtime.call FunctionOn", { objectId: objectId, functionDeclaration: functionDeclaration, arg uments: callArguments, returnByValue: returnByValue, generatePreview: generatePr eview, awaitPromise: awaitPromise })); 112 return promise.then(() => InspectorTest.sendCommandPromise("Runtime.call FunctionOn", { objectId: objectId, functionDeclaration: functionDeclaration, arg uments: callArguments, returnByValue: returnByValue, generatePreview: generatePr eview, awaitPromise: awaitPromise }));
113 113
114 function addArgument(result) 114 function addArgument(result)
115 { 115 {
116 if (result.objectId) 116 if (result.objectId) {
117 callArguments.push({ objectId: result.objectId, type: result.typ e }); 117 callArguments.push({ objectId: result.objectId });
118 else if (result.value) 118 } else if (result.value) {
119 callArguments.push({ value: result.value, type: result.type }) 119 callArguments.push({ value: result.value })
120 else 120 } else if (result.unserializableValue) {
121 callArguments.push({ type: result.type }); 121 callArguments.push({ unserializableValue: result.unserializableV alue });
122 } else if (result.type === "undefined") {
123 callArguments.push({});
124 } else {
125 InspectorTest.log("Unexpected argument object:");
126 InspectorTest.logObject(result);
127 InspectorTest.completeTest();
128 }
122 } 129 }
123 } 130 }
124 131
125 function dumpResult(result) 132 function dumpResult(result)
126 { 133 {
127 if (result.exceptionDetails && result.exceptionDetails.scriptId) 134 if (result.exceptionDetails && result.exceptionDetails.scriptId)
128 result.exceptionDetails.scriptId = 0; 135 result.exceptionDetails.scriptId = 0;
129 if (result.result && result.result.objectId) 136 if (result.result && result.result.objectId)
130 result.result.objectId = "[ObjectId]"; 137 result.result.objectId = "[ObjectId]";
131 InspectorTest.logObject(result); 138 InspectorTest.logObject(result);
132 } 139 }
133 } 140 }
134 </script> 141 </script>
135 </head> 142 </head>
136 <body onLoad="runTest();"> 143 <body onLoad="runTest();">
137 Tests that Runtime.callFunctionOn works with awaitPromise flag. 144 Tests that Runtime.callFunctionOn works with awaitPromise flag.
138 </body> 145 </body>
139 </html> 146 </html>
140 147
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698