Skip to content

Commit

Permalink
Update according to the review comments
Browse files Browse the repository at this point in the history
1. Change the manual test to reference test
2. Refactor the events tests
3. Remove the usemap test
4. Update the test and assert descriptions and etc

Signed-off-by: xiaojunwu <[email protected]>
  • Loading branch information
xiaojunwu committed Mar 25, 2014
1 parent e546ac5 commit 5e02231
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 112 deletions.
6 changes: 0 additions & 6 deletions html/semantics/embedded-content/the-object-element/blue.html

This file was deleted.

6 changes: 0 additions & 6 deletions html/semantics/embedded-content/the-object-element/green.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div id="log"></div>
<form>
<object id="obj1" data="blue.html" name="o" height="50" width="100"></object>
<object id="obj2" data="/images/blue.png" name="p" type="image/png"></object>
<object id="obj2" name="p" type="image/png"></object>
</form>
<script>
var obj1;
Expand Down Expand Up @@ -37,7 +37,7 @@
t1.done()

t2.step(function() {
assert_equals(obj1.form, document.forms[0], "The form attribute is incorrect.");
assert_equals(obj1.form, document.forms[0], "Missing form attribute returns the nearest ancestor form element.");
});
t2.done();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,43 @@
<div id="log"></div>
<script>

var t1 = async_test("error event");
var t2 = async_test("load event");
var t3 = async_test("load event of about:blank");

setup(function () {
async_test(function(t1) {
var obj1 = document.createElement("object");
var obj2 = document.createElement("object");
var obj3 = document.createElement("object");
obj1.data = "test.html";
obj2.data = "/images/blue.png";
obj3.data = "about:blank";

obj1.onerror = t1.step_func_done(function (e) {
obj1.onerror = t1.step_func_done(function(e){
assert_true(e.isTrusted, "The error event should be a truested event.");
assert_false(e.cancelable, "The error event should not be a cancelable event.");
assert_false(e.bubbles, "The error event should not be a bubble event.");
assert_equals(e.target, obj1, "The error event target should be the corresponding object element.");
assert_true(e instanceof Event, "The load event should be an instance of Event interface.");
assert_true(e instanceof Event, "The error event should be an instance of Event interface.");
});
obj1.data = "test.html";
document.body.appendChild(obj1);
}, "eroor event");

obj2.onload = t2.step_func_done(function (e) {
async_test(function(t2) {
var obj2 = document.createElement("object");
obj2.onload = t2.step_func_done(function(e){
assert_true(e.isTrusted, "The load event should be a truested event.");
assert_false(e.cancelable, "The load event should not be a cancelable event.");
assert_false(e.bubbles, "The load event should not be a bubble event.");
assert_equals(e.target, obj2, "The load event target should be the corresponding object element.");
assert_true(e instanceof Event, "The load event should be an instance of Event interface.");
});
obj2.data = "/images/blue.png";
document.body.appendChild(obj2);
}, "load event");

obj3.onload = t3.step_func_done(function (e) {
async_test(function(t3) {
var obj3 = document.createElement("object");
obj3.onload = t3.step_func_done(function(e){
assert_true(e.isTrusted, "The laod event should be a truested event.");
assert_false(e.cancelable, "The load event should not be a cancelable event.");
assert_false(e.bubbles, "The load event should not be a bubble event.");
assert_equals(e.target, obj3, "The load event target should be the corresponding object element.");
assert_true(e instanceof Event, "The load event should be an instance of Event interface.");
});

document.body.appendChild(obj1);
document.body.appendChild(obj2);
obj3.data = "about:blank";
document.body.appendChild(obj3);
});
}, "load event of about:blank");

</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: display fallback content reference</title>
<p>Test passes if there is <strong>no blue</strong>, and 'PASS' is displayed.</p>
<p>PASS</p>
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<meta charset="utf-8">
<title>HTML Test: display fallback content</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="flag" content="interact"></meta>
<meta name="assert" content="The object element will not display when its type attribute does not match the source specified by data attribute">
<p>Test passes if there is <strong>no blue</strong>, and 'PASS' is displayed.</p>
<link rel="match" content="object-fallback-ref.html" >
<meta name="assert" content="The object element will not display when its type
attribute does not match the source specified by the data attribute">
<p>Test passes if there is <strong>no blue</strong>, and 'PASS' is displayed.</p>
<object data="/images/blue.png" type="text/plain" typemustmatch>
<p>PASS</p>
<p>PASS</p>
</object>
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,29 @@
<div id="result" style="display:none"></div>
<script>

var result;
var t1 = async_test("The nested browsing context must be navigated to the resource specified by the data attribute.");
var t1 = async_test("The nested browsing context must be navigated to the resourceresource specified by the data attribute.");
var t2 = async_test("The object.data must not be updated if the browsing context gets further navigated.");
var testEle;

setup(function() {
testEle = document.getElementById("test");
result = document.getElementById("result");
window.addEventListener("message", callback, false);
});

function callback(e) {
if (e.data == "test0 loaded") {
t1.step(function() {
var result = document.getElementById("result");
assert_true(testEle.data.indexOf("test0.html") != -1, "The value of attribute data should not be updated.");
assert_equals(result.innerHTML, "1", "The soruce specified by data attribute of object element is not loaded.");
assert_equals(result.innerHTML, "1", "The source specified by data attribute of object element is not loaded.");
});
t1.done();
} else if (e.data == "test1 loaded") {
t2.step(function() {
assert_true(testEle.contentDocument.location.href.indexOf("test1.html") != -1, "The bowser context should be navigated to test1.html.");
assert_true(testEle.contentDocument.location.href.indexOf("test1.html") != -1, "The browsing context should be navigated to test1.html.");
assert_true(testEle.data.indexOf("test0.html") != -1, "The value of attribute data should not be updated.");
});
t2.done();
}
}

</script>

This file was deleted.

6 changes: 0 additions & 6 deletions html/semantics/embedded-content/the-object-element/red.html

This file was deleted.

Binary file not shown.
21 changes: 0 additions & 21 deletions html/semantics/embedded-content/the-object-element/test2.html

This file was deleted.

6 changes: 0 additions & 6 deletions html/semantics/embedded-content/the-object-element/white.html

This file was deleted.

This file was deleted.

0 comments on commit 5e02231

Please sign in to comment.