Index: test/inspector/runtime/evaluate-with-generate-preview.js |
diff --git a/test/inspector/runtime/evaluate-with-generate-preview.js b/test/inspector/runtime/evaluate-with-generate-preview.js |
index 5e747d5ab9ea695c78d1e4bf903f18438ecdea68..5e8f34a283406fa9ae9ec3d3a46a24ab6b594466 100644 |
--- a/test/inspector/runtime/evaluate-with-generate-preview.js |
+++ b/test/inspector/runtime/evaluate-with-generate-preview.js |
@@ -6,35 +6,43 @@ print("Tests that Runtime.evaluate will generate correct previews."); |
InspectorTest.addScript( |
` |
+var f1 = function(){}; |
+ |
Object.prototype[0] = 'default-first'; |
-var obj = {p1: {a:1}, p2: {b:'foo'}}; |
+var obj = {p1: {a:1}, p2: {b:'foo'}, p3: f1}; |
Object.defineProperties(obj, { |
- p3: { |
+ p4: { |
get() { return 2 } |
}, |
- p4: { |
+ p5: { |
set(x) { return x } |
}, |
- p5: { |
+ p6: { |
get() { return 2 }, |
set(x) { return x } |
} |
}); |
Array.prototype[0] = 'default-first'; |
-var arr = [,, 1, [2]]; |
+var arr = [,, 1, [2], f1]; |
Object.defineProperties(arr, { |
- 4: { |
+ 5: { |
get() { return 2 } |
}, |
- 5: { |
+ 6: { |
set(x) { return x } |
}, |
- 6: { |
+ 7: { |
get() { return 2 }, |
set(x) { return x } |
} |
}); |
+arr.nonEntryFunction = f1; |
+ |
+var inheritingObj = {}; |
+var inheritingArr = []; |
+inheritingObj.prototype = obj; |
+inheritingArr.prototype = arr; |
`); |
InspectorTest.runTestSuite([ |
@@ -50,5 +58,19 @@ InspectorTest.runTestSuite([ |
Protocol.Runtime.evaluate({ "expression": "arr", "generatePreview": true }) |
.then(result => InspectorTest.logMessage(result.result.result.preview)) |
.then(next); |
+ }, |
+ |
+ function testInheritingObjectPropertiesPreview(next) |
+ { |
+ Protocol.Runtime.evaluate({ "expression": "inheritingObj", "generatePreview": true }) |
+ .then(result => InspectorTest.logMessage(result.result.result.preview)) |
+ .then(next); |
+ }, |
+ |
+ function testInheritingArrayPropertiesPreview(next) |
+ { |
+ Protocol.Runtime.evaluate({ "expression": "inheritingArr", "generatePreview": true }) |
+ .then(result => InspectorTest.logMessage(result.result.result.preview)) |
+ .then(next); |
} |
]); |