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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.html

Issue 1948583003: [DevTools] Runtime.getProperties on proxy object doesn't call traps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.html
new file mode 100644
index 0000000000000000000000000000000000000000..afaf0a7d101ab300782e1a363f51942c239a395c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.html
@@ -0,0 +1,107 @@
+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
+<script>
+
+function testFunction()
+{
+ window.counter = 0;
+ var handler = {
+ get: function(target, name){
+ window.counter++;
+ return Reflect.get.apply(this, arguments);
+ },
+ set: function(target, name){
+ window.counter++;
+ return Reflect.set.apply(this, arguments);
+ },
+ getPrototypeOf: function(target) {
+ window.counter++;
+ return Reflect.getPrototypeOf.apply(this, arguments);
+ },
+ setPrototypeOf: function(target) {
+ window.counter++;
+ return Reflect.setPrototypeOf.apply(this, arguments);
+ },
+ isExtensible: function(target) {
+ window.counter++;
+ return Reflect.isExtensible.apply(this, arguments);
+ },
+ isExtensible: function(target) {
+ window.counter++;
+ return Reflect.isExtensible.apply(this, arguments);
+ },
+ isExtensible: function(target) {
+ window.counter++;
+ return Reflect.isExtensible.apply(this, arguments);
+ },
+ preventExtensions: function() {
+ window.counter++;
+ return Reflect.preventExtensions.apply(this, arguments);
+ },
+ getOwnPropertyDescriptor: function() {
+ window.counter++;
+ return Reflect.getOwnPropertyDescriptor.apply(this, arguments);
+ },
+ defineProperty: function() {
+ window.counter++;
+ return Reflect.defineProperty.apply(this, arguments);
+ },
+ has: function() {
+ window.counter++;
+ return Reflect.has.apply(this, arguments);
+ },
+ get: function() {
+ window.counter++;
+ return Reflect.get.apply(this, arguments);
+ },
+ set: function() {
+ window.counter++;
+ return Reflect.set.apply(this, arguments);
+ },
+ deleteProperty: function() {
+ window.counter++;
+ return Reflect.deleteProperty.apply(this, arguments);
+ },
+ ownKeys: function() {
+ window.counter++;
+ return Reflect.ownKeys.apply(this, arguments);
+ },
+ apply: function() {
+ window.counter++;
+ return Reflect.apply.apply(this, arguments);
+ },
+ construct: function() {
+ window.counter++;
+ return Reflect.construct.apply(this, arguments);
+ }
+ };
+ return new Proxy({ a : 1}, handler);
+}
+
+function test()
+{
+ InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: "testFunction()"}, requestProperties);
+
+ function requestProperties(result)
+ {
+ InspectorTest.sendCommandOrDie("Runtime.getProperties", { objectId: result.result.objectId, generatePreview: true }, checkCounter);
+ }
+
+ function checkCounter(result)
+ {
+ InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: "window.counter" }, dumpCounter);
+ }
+
+ function dumpCounter(result)
+ {
+ InspectorTest.logObject(result);
+ InspectorTest.completeTest();
+ }
+}
+</script>
+</head>
+<body onLoad="runTest();">
+Check that while Runtime.getProperties call on proxy object no user defined trap will be executed.
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698