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

Unified Diff: test/inspector/runtime/evaluate-with-generate-preview.js

Issue 2554623003: Show functions in object previews (Closed)
Patch Set: rebase to drop symbool cl Created 4 years 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/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);
}
]);
« no previous file with comments | « src/inspector/injected-script-source.js ('k') | test/inspector/runtime/evaluate-with-generate-preview-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698