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

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

Issue 2954093003: [DevTools] Migrate inspector-protocol/runtime tests to new harness (Closed)
Patch Set: fail: Created 3 years, 6 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.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.js b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.js
new file mode 100644
index 0000000000000000000000000000000000000000..e91fd1292f6279213da6035d1d47fe247f316cb4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-get-properties-on-proxy.js
@@ -0,0 +1,84 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank(`Check that while Runtime.getProperties call on proxy object no user defined trap will be executed.`);
+
+ 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);
+ }
+
+ var response = await dp.Runtime.evaluate({expression: '(' + testFunction.toString() + ')()'});
+ await dp.Runtime.getProperties({ objectId: response.result.result.objectId, generatePreview: true });
+ response = await dp.Runtime.evaluate({ expression: 'window.counter' });
+ testRunner.logObject(response.result);
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698