4 function print(message
, color
)
6 var paragraph
= document
.createElement("div");
7 paragraph
.appendChild(document
.createTextNode(message
));
8 paragraph
.style
.fontFamily
= "monospace";
10 paragraph
.style
.color
= color
;
11 document
.getElementById("console").appendChild(paragraph
);
16 document
.getElementById('pre').appendChild(document
.createTextNode(s
));
19 function shouldBe(a
, b
)
23 print("PASS: " + a
+ " should be " + b
+ " and is.", "green");
25 print("FAIL: " + a
+ " should be " + b
+ " but instead is " + evalA
+ ".", "red");
32 if (window
.testRunner
)
33 testRunner
.dumpAsText();
35 embed
= document
.getElementById('embed');
36 print("[Embed is element specified in markup]");
42 embed
.type
= 1; // setting the type attribute should not effect the plugin once loaded
43 embed
.src
= 1; // setting the source attribute should not effect the plugin once loaded
45 shouldBe("embed.getAttribute('align')", 1);
46 shouldBe("embed.getAttribute('height')", 1);
47 shouldBe("embed.getAttribute('name')", 1);
48 shouldBe("embed.getAttribute('width')", 1);
49 shouldBe("embed.getAttribute('type')", 1);
50 shouldBe("embed.getAttribute('src')", 1);
51 shouldBe("typeof embed.testCallback", "function");
55 embed
= document
.createElement('embed');
56 print("[Embed is dynamically created element with only type specified]");
58 embed
.style
.visibility
= "hidden";
59 embed
.type
= "application/x-webkit-test-netscape";
60 document
.body
.appendChild(embed
);
61 shouldBe("typeof embed.testCallback", "function");
65 embed
= document
.createElement('embed');
66 print("[Embed is dynamically created element with only src specified]");
68 embed
.style
.visibility
= "hidden";
69 embed
.src
= "resources/test.testnetscape";
70 document
.body
.appendChild(embed
);
71 shouldBe("typeof embed.testCallback", "function");
76 <body onload=
"test();">
79 <div id='console'
></div>
81 <embed style=
"visibility: hidden" type=
"application/x-webkit-test-netscape" id='embed'
></embed>