| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
| 3 <title>Event constructors</title> | 3 <title>Event constructors</title> |
| 4 <script src="../../../../resources/testharness.js"></script> | 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="../../../../resources/testharnessreport.js"></script> | 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <div id="log"></div> | 6 <div id="log"></div> |
| 7 <script> | 7 <script> |
| 8 function assert_props(iface, event, defaults) { | 8 function assert_props(iface, event, defaults) { |
| 9 assert_true(event instanceof self[iface]); | 9 assert_true(event instanceof self[iface]); |
| 10 expected[iface].properties.forEach(function(p) { | 10 expected[iface].properties.forEach(function(p) { |
| 11 var property = p[0], value = p[defaults ? 1 : 2]; | 11 var property = p[0], value = p[defaults ? 1 : 2]; |
| 12 assert_true(property in event, | 12 assert_true(property in event, |
| 13 "Event " + format_value(event) + " should have a " + | 13 "Event " + format_value(event) + " should have a " + |
| 14 property + " property"); | 14 property + " property"); |
| 15 assert_equals(event[property], value, | 15 assert_equals(event[property], value, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 assert_props(iface, event, false); | 144 assert_props(iface, event, false); |
| 145 }, iface + " constructor (argument with non-default values)"); | 145 }, iface + " constructor (argument with non-default values)"); |
| 146 }); | 146 }); |
| 147 | 147 |
| 148 test(function () { | 148 test(function () { |
| 149 assert_throws(new TypeError(), function() { | 149 assert_throws(new TypeError(), function() { |
| 150 new UIEvent("x", { view: 7 }) | 150 new UIEvent("x", { view: 7 }) |
| 151 }); | 151 }); |
| 152 }, "UIEvent constructor (view argument with wrong type)") | 152 }, "UIEvent constructor (view argument with wrong type)") |
| 153 </script> | 153 </script> |
| OLD | NEW |