https://github.com/web-platform-tests/wpt
Raw File
Tip revision: f3eea8d31d07201e4ada8203be7e4d1ee5227697 authored by Robin Berjon on 09 December 2013, 16:11:17 UTC
import latest tests from html5lib-tests; including new-ruby tests (in html/syntax/parsing/html5lib_tests19.html)
Tip revision: f3eea8d
interface-objects.html
<!DOCTYPE html>
<title>Interfaces</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
function testInterfaceDeletable(iface) {
  test(function() {
    assert_true(!!window[iface], "Interface should exist.")
    assert_true(delete window[iface], "The delete operator should return true.")
    assert_equals(window[iface], undefined, "Interface should be gone.")
  }, "Should be able to delete " + iface + ".")
}
var interfaces = [
  "Event",
  "CustomEvent",
  "EventTarget",
  "Node",
  "Document",
  "DOMImplementation",
  "DocumentFragment",
  "ProcessingInstruction",
  "DocumentType",
  "Element",
  "Attr",
  "CharacterData",
  "Text",
  "Comment",
  "NodeIterator",
  "TreeWalker",
  "NodeFilter",
  "NodeList",
  "HTMLCollection",
  "DOMStringList",
  "DOMTokenList",
  "DOMSettableTokenList"
];
test(function() {
  for (var p in window) {
    interfaces.forEach(function(i) {
      assert_not_equals(p, i)
    })
  }
}, "Interface objects properties should not be Enumerable")
interfaces.forEach(testInterfaceDeletable);
</script>
back to top