-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new test files from TestTWF #80
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<body onload="load_test_attr.done()"> | ||
<h1>HTMLAllCollection Tests</h1> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't really need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
<img src="http://www.w3.org/Icons/w3c_home" name="picture"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not depend on external resources. These tests are run by us browser vendors inside our own internal testing systems. And they don't like external resources (because suddenly they move, or the server is down or something). Causes lots of noise and uncertainty. Does it have to be an img? Can it be an img with a data-src then instead maybe? If not you can find quite a lot of resources e.g. in the root of web-platform tests. So you'd do Yeah, a bit ugly but it works. But data-src would probably work well enough :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks to me like it's irrelevant to the tests what the src is or even what kind of element it is. They're just matching up the node name and the tag name in various ways. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, in this test it probably is. But sometimes cases like this really do test obscure things like "all" being updated even with unloaded image tags, etc etc. But you're right, as far as I can read the test only needs an element. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Used your suggested resource. |
||
<p>There should be eight tests </p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is way too hard to keep up to date. And why should it say so anyway? :-) The tests should always reliably fail if they don't pass. (And not vary in number). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
<div id="log"></div> | ||
<script src="testharness.js"></script> | ||
<script src="testharnessreport.js"></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two should be And the log should be after the scripts. That last point only because it is most common to do so, you could put it wherever :P There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated references and moved the log. |
||
<script> | ||
setup({explicit_done:true}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This type of test should not need to have an explicit done. It was possibly because of the external image load you wanted to do that? Anyway, it should be done without. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the explicit done. |
||
{test(function(){ assert_true(document.all.length == 10)}, "Test for HTMLAllCollection size");} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are not space constrained, it would be better to get this written out in full. And use assert_equals() instead of doing your own equality check. So: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated using assert_equals for all the tests |
||
{test(function(){ assert_true(document.all.item(0).tagName == "HTML")}, "Test lookup by index using ()");} | ||
{test(function(){ assert_true(document.all[0].tagName == "HTML")}, "Test lookup by index using []");} | ||
{test(function(){ assert_true(document.all.tags("script").length == 3)}, "Test for multiple occurence 3 <script> found");} | ||
{test(function(){ assert_true(document.all.item("picture").nodeName == "IMG")}, "Test lookup IMG by name");} | ||
{test(function(){ assert_true(document.all.namedItem("picture").nodeName == "IMG")}, "Test lookup IMG by namedItem ");} | ||
{test(function(){ assert_true(document.all("picture").nodeName == "IMG")}, "Test lookup IMG in collection using ()");} | ||
{test(function(){ assert_true(document.all["picture"].nodeName == "IMG")}, "Test lookup IMG in collection using []");} | ||
onload = function() {done();} | ||
</script> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bogus onload :-)
Also, you need metadata: your author info, plus a meta help to the relevant place in the spec for this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed