[Extensions] Improve chrome.test.assert(Eq|Ne) equality checking
Improves equality checking for:
- Maps, Sets, and sparse arrays
- Primitive Wrappers: Boolean, Number, String
- Date, NaN, and functions
It does this deep equality checking by updating the `checkDeepEq`
implementation in `test_custom_bindings.js` to support recursive value
checking for Map and Set objects. This logic handles keys and values
in an order-independent manner.
Additionally, this improves documentation by:
- Modifying error messages to display:
- value types on mismatches
- raw values when JSON.stringify fails (example: undefined)
- Adding API docs for checkDeepEq and assertNe
- Explicitly documenting the lack of null+undefined comparisons
Buddy: solomonkinard@ who wrote the initial version of the test code.
Bug: 466303357
Change-Id: I6cdf1a1c958a3431e1704ff2dbac73ce819064be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7233732
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Commit-Queue: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Solomon Kinard <solomonkinard@chromium.org>
Auto-Submit: Justin Lulejian <jlulejian@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1561288}
NOKEYCHECK=True
GitOrigin-RevId: b4ceb27b0ed696801c19cd332bd5002455aa3aa0
1 file changed