Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: LayoutTests/imported/web-platform-tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html

Issue 1159053005: W3C Test: import web-platform-tests/html/{introduction,obsolete} (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/imported/web-platform-tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html
diff --git a/LayoutTests/imported/web-platform-tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html b/LayoutTests/imported/web-platform-tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html
new file mode 100644
index 0000000000000000000000000000000000000000..f6b29fdfbd43a93a77431540b01a8f0740c6ebf3
--- /dev/null
+++ b/LayoutTests/imported/web-platform-tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-events</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<script src="../../../../../../resources/testharness.js"></script>
+<script src="../../../../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<marquee id="test1" loop="2" width="1" behavior="alternate">&nbsp;</marquee>
+<marquee id="test2" loop="2" width="1">&nbsp;</marquee>
+<script>
+ var mq;
+ var t_start = async_test("marquee_events_start");
+ var t_finish = async_test("marquee_events_finish");
+ var t_bounce = async_test("marquee_events_bounce");
+ var t_bounce2 = async_test("marquee_events_bounce2");
+ var timeStamp = [];
+ var bounced = false;
+
+ setup(function() {
+ mq = document.getElementById("test1");
+ mq2 = document.getElementById("test2");
+ });
+
+ mq.addEventListener("start", function(evt) {
+ t_start.step(function() {
+ timeStamp.push(evt.timeStamp);
+ assert_true(evt.isTrusted, "The onstart event is created by UA, it must be trusted.");
+ assert_equals(timeStamp.length, 1, "The onstart event should be fired firstly.");
+ assert_false(evt.bubbles, "The bubbles property of onstart event should be false.");
+ assert_false(evt.cancelable, "The cancelable property of onstart event should be false.");
+ assert_true(evt instanceof Event, "The onstart event must be the instance of Event interface.");
+ });
+ t_start.done();
+ });
+
+ mq.addEventListener("finish", function(evt) {
+ t_finish.step(function() {
+ timeStamp.push(evt.timeStamp);
+ assert_true(evt.isTrusted, "The onfinish event is created by UA, it must be trusted.");
+ assert_equals(timeStamp.length, 3, "The onfinish event should be fired lastly.");
+ assert_false(evt.bubbles, "The bubbles property of onfinish event should be false.");
+ assert_false(evt.cancelable, "The cancelable property of onfinish event should be false.");
+ assert_true(evt instanceof Event, "The onfinish event must be the instance of Event interface.");
+ });
+ t_finish.done();
+ });
+
+ mq.addEventListener("bounce", function(evt) {
+ t_bounce.step(function() {
+ timeStamp.push(evt.timeStamp);
+ assert_true(evt.isTrusted, "The onbounce event is created by UA, it must be trusted.");
+ assert_equals(timeStamp.length, 2, "The onbounce event should be fired secondly.");
+ assert_false(evt.bubbles, "The bubbles property of onbounce event should be false.");
+ assert_false(evt.cancelable, "The cancelable property of onbounce event should be false.");
+ assert_true(evt instanceof Event, "The onbounce event must be the instance of Event interface.");
+ });
+ t_bounce.done();
+ });
+
+ mq2.addEventListener("bounce", function(evt) {
+ bounced = true;
+ });
+
+ mq2.addEventListener("finish", function(evt) {
+ t_bounce2.step(function () {
+ assert_false(bounced, "The onbounce event should not be fired.");
+ });
+ t_bounce2.done();
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698