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

Unified Diff: test/inspector/runtime/get-properties.js

Issue 2705533002: [inspector] remove iterators and for...of loops from injected-script-source (Closed)
Patch Set: ac Created 3 years, 10 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: test/inspector/runtime/get-properties.js
diff --git a/test/inspector/runtime/get-properties.js b/test/inspector/runtime/get-properties.js
index 579e5422d99ba14d78f4a92db2168e4b480f3e04..af5e8a67b5a081bb8f0544e05f0e7dc0c9f8bed1 100644
--- a/test/inspector/runtime/get-properties.js
+++ b/test/inspector/runtime/get-properties.js
@@ -176,6 +176,46 @@ function callbackEvalBound(result)
function callbackPropertiesBound(result)
{
logGetPropertiesResult("Bound function", result);
+ return { callback: callbackStartObjectThrowsLength };
+}
+
+
+// Object throws on length access
+
+function callbackStartObjectThrowsLength() {
+ var expression = "({get length() { throw 'Length called'; }})";
+ return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalObjectThrowsLength };
+}
+function callbackEvalObjectThrowsLength(result) {
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "Runtime.getProperties", params: {objectId: id, ownProperties: true}, callback: callbackPropertiesObjectThrowsLength
+ };
+}
+function callbackPropertiesObjectThrowsLength(result) {
+ logGetPropertiesResult("Object that throws on length access", result);
+ return { callback: callbackStartTypedArrayWithoutLength };
+}
+
+
+// Typed array without length
+
+function callbackStartTypedArrayWithoutLength() {
+ var expression = "({__proto__: Uint8Array.prototype})";
+ return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalTypedArrayWithoutLength };
+}
+function callbackEvalTypedArrayWithoutLength(result) {
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "Runtime.getProperties", params: {objectId: id, ownProperties: true}, callback: callbackPropertiesTypedArrayWithoutLength
+ };
+}
+function callbackPropertiesTypedArrayWithoutLength(result) {
+ logGetPropertiesResult("TypedArray without length", result);
return; // End of test
}
« no previous file with comments | « test/inspector/runtime/evaluate-with-generate-preview-expected.txt ('k') | test/inspector/runtime/get-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698