mirror of
https://github.com/servo/servo.git
synced 2025-09-20 11:50:09 +01:00
Add test for overloading with interface and dict
This commit is contained in:
parent
c24481ab9c
commit
58bab8a7e9
6 changed files with 49 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
|||
[overload_dict.html]
|
||||
type: testharness
|
||||
prefs: [dom.testbinding.enabled:true]
|
|
@ -14088,6 +14088,13 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"overload_dict.html": [
|
||||
"cd42fd97331753fc0580a47a39814cff57911638",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"paint_timing.html": [
|
||||
"0c1798ec565a77d20d9550b5cec352a0b286c415",
|
||||
[
|
||||
|
|
3
tests/wpt/mozilla/meta/mozilla/overload_dict.html.ini
Normal file
3
tests/wpt/mozilla/meta/mozilla/overload_dict.html.ini
Normal file
|
@ -0,0 +1,3 @@
|
|||
[overload_dict.html]
|
||||
type: testharness
|
||||
prefs: [dom.testbinding.enabled:true]
|
18
tests/wpt/mozilla/tests/mozilla/overload_dict.html
Normal file
18
tests/wpt/mozilla/tests/mozilla/overload_dict.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for overload with dictionary object</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = new TestBinding();
|
||||
|
||||
assert_equals(t.passOverloadedDict({href: "a"}), "a");
|
||||
assert_equals(t.passOverloadedDict(document.documentElement), "node");
|
||||
// interface objects should be converted to the dictionary if
|
||||
// they're incompatible with the interface
|
||||
// See https://github.com/servo/servo/pull/26154
|
||||
assert_equals(t.passOverloadedDict(new URL("https://example.org/foo")), "https://example.org/foo");
|
||||
|
||||
}, "Overload of dictionary and interface item works")
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue