Commit Graph

12 Commits

Author SHA1 Message Date
Luca Greco 5ab825b83f
fix: Reject with real Error instances like Firefox does (#293)
Co-authored-by: Federico Brigante <me@fregante.com>
2021-03-18 18:07:16 +01:00
Luca Greco 2005a2ca22 chore: Updated sinon to version 7.5.0 2019-11-27 13:38:52 +01:00
Rob Wu d612352bba fix: resolve to undefined instead of an empty array 2018-07-04 13:17:09 +02:00
Luca Greco 917ed413f6 fix: Add a new fallbackToNoCallback metadata property to customize the pageAction.show/hide wrappers behavior 2018-03-13 14:27:22 +01:00
Luca Greco 61d92ea79b feat: Added devtools.inspectedWindow.eval and devtools.panels.create to wrapped APIs.
To be able to wrap the devtools API namespaces, this patch applies the
following changes:

- fix: Prevent Proxy violation exception on the read-only/non-configurable devtools property
  by using an empty object with the `chrome` API object as its prototype
  as the root Proxy target (the Proxy instances returned for the
  `chrome` API object) and add a related test case.

- fix: Added support for a new `singleCallbackArg` metadata property,
  which prevents devtools.panels.create to resolve an array of
  parameters (See the related Chromium issue at
  https://bugs.chromium.org/p/chromium/issues/detail?id=768159)
  and add the related test cases.

- test: Changes to the test case related to proxy getter/setter behavior
  on non wrapped properties:

  in the "deletes proxy getter/setter that are not wrapped" test case from
  the "test-proxied-properties.js" test file, we ensure that when a
  getter/setter is called for a "non-wrapped" property, the getter/setter
  is going to affect the original target object, unfortunately this in
  not true anymore for the root object (the `chrome` API object) because
  we are using an empty object (which has the `chrome` API object as its
  prototype and it is not exposed outside of the polyfill sources)
  as the target of the Proxy instance related to it,
  this change to the target of the Proxy has been needed to prevent the
  TypeError exception raised by the Proxy instance when we try to access
  the "devtools" property (which is non-configurable and read-only on the
  `chrome` API object).
2017-09-25 22:20:07 +02:00
Luca Greco 9a04fc3876 fix: pluralize argument in raised error message 2016-11-07 16:34:34 +01:00
Luca Greco 6486e551be fix: bulk fix call expression params indentation using eslint 2016-11-07 16:34:34 +01:00
Luca Greco 3842bd1693 style: destructure the assert methods to globals 2016-11-07 16:34:34 +01:00
Luca Greco a585b4b07a test: added test case for async function rejection, and arguments length validation. 2016-11-07 16:34:34 +01:00
Luca Greco f28858961f fix: cleanup async function tests and other minor tweaks on tests. 2016-11-07 16:34:34 +01:00
Luca Greco b0a111cdc7 fix: init fake runtime.lastError to null. 2016-11-07 16:34:34 +01:00
Luca Greco c08b8af982 test: introduced a test suite for unit testing. 2016-11-07 16:33:42 +01:00