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

Unified Diff: LayoutTests/fast/svg/script-tests/animation-events.js

Issue 201673003: [SVG2] Add onbegin, onend and onrepeat EventHandlers on SVGAnimationElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fs review Created 6 years, 9 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
« no previous file with comments | « LayoutTests/fast/svg/animation-events.html ('k') | Source/core/svg/SVGAnimationElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/svg/script-tests/animation-events.js
diff --git a/LayoutTests/fast/dom/script-tests/event-handlers.js b/LayoutTests/fast/svg/script-tests/animation-events.js
similarity index 52%
copy from LayoutTests/fast/dom/script-tests/event-handlers.js
copy to LayoutTests/fast/svg/script-tests/animation-events.js
index d3d724999ab70da9b3e2d0b7a446a5d61c7084b7..35a859f2f6074e72df6d941c3c29c55b0c4f4950 100644
--- a/LayoutTests/fast/dom/script-tests/event-handlers.js
+++ b/LayoutTests/fast/svg/script-tests/animation-events.js
@@ -1,37 +1,21 @@
function getObject(interface) {
switch(interface) {
- case "Element":
- var e = document.createElementNS("http://example.com/", "example");
- assert_true(e instanceof Element);
- assert_false(e instanceof HTMLElement);
- assert_false(e instanceof SVGElement);
+ case "SVGAnimateElement":
+ var e = document.createElementNS("http://www.w3.org/2000/svg", "animate");
+ assert_true(e instanceof SVGAnimateElement);
return e;
- case "HTMLElement":
- var e = document.createElement("html");
- assert_true(e instanceof HTMLElement);
+ case "SVGAnimateMotionElement":
+ var e = document.createElementNS("http://www.w3.org/2000/svg", "animateMotion");
+ assert_true(e instanceof SVGAnimateMotionElement);
return e;
- case "HTMLBodyElement":
- var e = document.createElement("body");
- assert_true(e instanceof HTMLBodyElement);
+ case "SVGAnimateTransformElement":
+ var e = document.createElementNS("http://www.w3.org/2000/svg", "animateTransform");
+ assert_true(e instanceof SVGAnimateTransformElement);
return e;
- case "HTMLFormElement":
- var e = document.createElement("form");
- assert_true(e instanceof HTMLFormElement);
+ case "SVGSetElement":
+ var e = document.createElementNS("http://www.w3.org/2000/svg", "set");
+ assert_true(e instanceof SVGSetElement);
return e;
- case "HTMLFrameSetElement":
- var e = document.createElement("frameset");
- assert_true(e instanceof HTMLFrameSetElement);
- return e;
- case "SVGElement":
- var e = document.createElementNS("http://www.w3.org/2000/svg", "rect");
- assert_true(e instanceof SVGElement);
- return e;
- case "Document":
- assert_true(document instanceof Document);
- return document;
- case "Window":
- assert_true(window instanceof Window);
- return window;
}
assert_unreached();
}
@@ -58,19 +42,6 @@ function testReflect(interface, attribute) {
element.removeAttribute(attribute);
}, "Reflect " + interface + "." + attribute);
}
-function testForwardToWindow(interface, attribute) {
- test(function() {
- var element = getObject(interface);
- window[attribute] = null;
- element.setAttribute(attribute, "return");
- assert_equals(typeof window[attribute], "function", "Convert to function");
- assert_equals(window[attribute], element[attribute], "Forward content attribute");
- function nop() {}
- element[attribute] = nop;
- assert_equals(window[attribute], nop, "Forward IDL attribute");
- window[attribute] = null;
- }, "Forward " + interface + "." + attribute + " to Window");
-}
// Object.propertyIsEnumerable cannot be used because it doesn't
// work with properties inherited through the prototype chain.
function getEnumerable(interface) {
@@ -80,6 +51,17 @@ function getEnumerable(interface) {
}
return enumerable;
}
+function testEventHandlerMapping(attribute, eventname) {
+ async_test(function(t) {
+ var element = getObject("SVGAnimateElement");
+ assert_false(element.hasAttribute(attribute), "Initially missing");
+ element[attribute] = function() {
+ t.step(function (){assert_true(true); t.done();});
+ };
+ var event = new CustomEvent(eventname);
+ element.dispatchEvent(event);
+ }, "Event " + eventname + " maps to " + attribute);
+}
var enumerableCache = {};
function testEnumerate(interface, attribute) {
if (!(interface in enumerableCache)) {
« no previous file with comments | « LayoutTests/fast/svg/animation-events.html ('k') | Source/core/svg/SVGAnimationElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698