TestCoverage/A-The-SVG-Micro-DOM

From SVG

This page is an archive of the previous Group's wiki from http://www.w3.org/Graphics/SVG/Group/wiki.


Test Coverage for SVG Tiny 1.2 Appendix A: The SVG Micro DOM (uDOM)

[1]

Legend:

 - is a comment or note
  is an assertion or feature that is fully covered in the test suite
 # is an assertion or feature that is partially or not covered in the test suite

A.2.1 Document Access

- "One way to gain access to the Document object is to implement the EventListenerInitializer2 interface. The SVG Tiny user agent will invoke the implementation’s initializeEventListeners method once the programming logic has been loaded and is ready to bind to the document."
 - impossible to test EventListenerInitializer2 from ECMAScript.

A.3.1 Attribute/Property Normalization

- might be hard to make tests for normalization, since it is optional. ← still some tests could be made, e.g. getting an SVGPath and ensuring no 'A' commands are in it

A.3.2 Text Content Access

 test of getTrait/setTrait with '#text' on desc,title,metadata,text,tspan,textArea.
 - udom-conform-201-t.svg

A.4.1 DOMException

 test existence of each ExceptionCode on DOMException.
 - udom-dom-201-t.svg

A.4.2 Node

 simple tests of namespaceURI/localName/parentNode/ownerDocument.
 - udom-dom-202-t.svg
 - udom-node-204-t.svg
 test textContent and that it removes child elements when setting.
 - udom-dom-203-t.svg
 - udom-textcontent-201-t.svg
 - udom-textcontent-202-t.svg
 test appendChild
 - udom-dom-204-t.svg
 test insertBefore.
 - udom-dom-205-t.svg
 test removeChild.
 - udom-dom-206-t.svg
 test cloneNode.
 - udom-dom-207-t.svg
 - udom-node-201-t.svg
 - udom-node-202-t.svg
 - udom-node-203-t.svg


# append/remove elements which cause other elements to change (e.g. adding elements with ids so that urirefs become valid).

A.4.3 Element

 test getAttribute(NS).
 - udom-dom-208-t.svg
 test setAttribute(NS).
 - udom-dom-209-t.svg

A.4.4 Document

- testing 'implementation' seems impossible.


 simple test of createElementNS for each element.
 - udom-dom-210-t.svg
 simple test of documentElement.
 - udom-dom-211-t.svg
 test getElementById for id and xml:id.
 - udom-dom-212-t.svg

A.4.5 ElementTraversal

 test all attributes.
 - udom-dom-213-t.svg

A.4.6 DOMImplementation

- nothing to test.

A.5.1 EventTarget

 test add/removeEventListener(NS).
 - udom-event-201-t.svg

A.5.2 EventListener

 test an EventListener given by a plain function.
 - udom-event-202-t.svg
 test an EventListener given by an object with a .handleEvent property.
 - udom-event-209-t.svg

A.5.3 Event

 test target,currentTarget,type,namespaceURI,cancelable.
 - udom-event-202-t.svg
 test stopPropagation.
 - udom-event-203-t.svg
 test defaultPrevented,preventDefault.
 - udom-event-204-t.svg

A.5.4 MouseEvent

 interactive tests for the various mouse events, testing button/clientX/Y.
 - udom-event-205-t.svg
 - screenX/Y probably not.

A.5.5 WheelEvent

 interactive test, make sure it is dispatched.
 - udom-event-210-t.svg
# make sure it is dispatched only to the document element.
 - udom-event-206-t.svg

A.5.6 TextEvent

 simple text input event test.
 - udom-event-207-t.svg

A.5.7 KeyboardEvent

 - hard to test, are there any common keys across devices?  this part of dom3ev is unstable anyway.

A.5.8 UIEvent

 test detail for events that care about it.
 - udom-event-208-t.svg

A.5.9 ProgressEvent

- worth having a test for this, if it will be moved out to webapi?
- I was going to work on some tests for that this week in WebAPI. I hope the spec will get to last call in June - it is due for publication as a WD checking if it is ready for LC as soon as W3C get back from the WWW/AC in Beijing. Chaals

A.5.10 ConnectionEvent

- same, worth doing this?  would be hard to test anyway.

A.6.1 ElementTimeControl

 test beginElement(At).
 - udom-smil-201-t.svg
 - udom-smil-202-t.svg
 - udom-svg-209-t.svg
 test endElement(At).
 - udom-smil-203-t.svg
 - udom-svg-209-t.svg

A.7.2 GlobalException

 test existence of ExceptionCode numbers.
 - udom-glob-201-t.svg

A.7.3 Connection

?


A.7.4 Timer

?


A.8.1 SVGException

 test ExceptionCode constants.
 - udom-svg-201-t.svg

A.8.2 SVGDocument

 test global refers to the global script object.
 - udom-svg-202-t.svg

A.8.3 SVGElementInstance

 test various simple and complex use trees to ensure their correspondingElement and correspondingUseElement attributes are set properly .
 - udom-svg-204-t.svg

A.8.4 SVGSVGElement

 test NAV_ constants.
- udom-svg-205-t.svg
 test setting currentScale to a valid/invalid value.
- udom-svg-206-t.svg


 test setting currentRotate to valid values
- udom-svg-219-t.svg
# test setting current to valid values.


 test that viewport is readonly.
 - udom-svg-212-t.svg


# test that viewport.x and .y are 0 (?? - only if standalone svg).


 test that getCurrentTime returns a "sensible" value.
 - udom-svg-213-t.svg


# test that setCurrentTime results in a "sensible" getCurrentTime afterwards.


 test that createSVGMatrixComponents does create an SVGMatrix with the right values.
 - udom-svg-214-t.svg
 test that createSVGRect results in a valid SVGRect object.
 - udom-svg-215-t.svg
 test that createSVGPath results in a valid SVGPath object.
 - udom-svg-216-t.svg


# test that createSVGRBColor results in a valid, mutable SVGRGBColor object.


# test that calling moveFocus will dispatch DOMFocusOut then DOMFocusIn, with correct .target values.  also test that invalid focus moves (both lack of nav-* attribute, and an invalid nav-* attribute) result in a DOMException with no events dispatched.


# test that initial focus is on the SVGDocument.


# test moveFocus with an invalid constant passed to it.


# test setFocus, similar to moveFocus tests.


# test getCurrentFocusedObject after various focus moves.

A.8.5 SVGRGBColor

# test red/green/blue values for the predefined colour constants, and the different colour syntaxes.

A.8.6 SVGRect

# test existence of x/y/width/height as floats.

A.8.7 SVGPoint

# test existence of x/y as floats.

A.8.8 SVGPath

# test path constants.


# test path segment querying methods on existing paths, including tests for DOMException raised with invalid path seg index.


# test path modification using moveTo/lineTo/quadTo/curveTo/close.

A.8.9 SVGMatrix

# test getComponent on a matrix given in a transform attribute, and test invalid index raising an exception.


# test mMultiply and resulting component values, and return value.


# test invert and resulting component values, and exception thrown on non-invertable matrix.


# test mTranslate and resulting component values, and return value.


# test mScale and resulting component values, and return value.


# test mRotate and resulting component values, and return value.

A.8.10 SVGLocatable

# many getBBox tests on different graphical objects, test that null is returned for elements not in the document tree, test that getBBox is not live.


# test getScreenCTM for various nested transforms, test that it is not live.


# test getScreenBBox for various nested transforms, test that it is not live.

A.8.12 TraitAccess

- impossible to test "attempting to access an undefined trait may throw an exception".


- tests for returned normalised values?


# test for incorrect accessor type throwing exceptions.


# test that computed values are returned for accessors of property attributes (inherited value, initial value).


# test for accessing non-property attributes (inherited, default value, null).


# test that getTrait* methods return base values, except that inherited values are the animated inherited values.


# test that getPresentationTrait* methods return animated values, or base if not animated.


# test setTrait* methods with valid/invalid/inherit values, with INVALID_ACCESS_ERR thrown for values "in error" or invalid "with regards to animations currently applied to the trait", and NOT_SUPPORTED_ERR for unsupported values.


# test that trait methods do not with with QName arguments.


# test that getTrait(X) is equivalent to getTraitNS(null, X).


# test that trait accessors that return objects are not live.


# test getRGBColorTrait (and getRGBColorPresentationTrait) throws TYPE_MISMATCH_ERR for 'none' or paint server references.


# test setTraitNS for xlink:href with an invalid uri.


# test set*Trait with null object passed in, throwing an exception.


# test setRectTrait with a SVGRect with negative width/height.


# test setPathTrait with an SVGPath that starts with a non-MOVE_TO command.


- no more default values for testing? (see [2])


# test that getTrait is supported for the same traits as getTraitNS, getPresentationTrait, getPresentationTraitNS.


# test that if get*Trait is supported, that get*PresentationTrait is supported.


# test that if setTrait is supported, setTraitNS is supported.


# test that traits cannot be used for font descriptors.


 accumulate.
 - udom-traitaccess-220-t.svg
 additive.
 - udom-traitaccess-221-t.svg
 attributeName.
 - udom-traitaccess-222-t.svg
 audio-level.
 - udom-traitaccess-225-t.svg
 baseProfile.
 - udom-traitaccess-223-t.svg
 begin.
 - udom-traitaccess-224-t.svg
# calcMode.
# color.
# cx.
# cy.
# d.
# display.
# dur.
# editable.
# end.
# fill.
 fill-rule.
# fill-opacity.
 - udom-traitaccess-204-t.svg
# focusable.
# focusHighlight.
# font-family.
# font-size.
# font-style.
# font-weight.
# from.
# gradientUnits.
# height.
# id.
# keyPoints.
# keySplines.
# keyTimes.
# max.
# min.
# nav-right.
# nav-next.
# nav-up.
# nav-up-right.
# nav-up-left.
# nav-prev.
# nav-down.
# nav-down-right.
# nav-down-left.
# nav-left.
# offset.
# opacity.
# path.
# points.
# r.
# repeatCount.
# repeatDur.
# restart.
# rx.
# ry.
# snapshotTime.
 solid-color.
 - udom-traitaccess-202-t.svg
 solid-opacity.
 - udom-traitaccess-203-t.svg
# stop-color.
# stop-opacity.
# stroke.
# stroke-dasharray.
# stroke-dashoffset.
# stroke-linecap.
# stroke-linejoin.
# stroke-miterlimit.
# stroke-opacity.
# stroke-width.
# target.
# text-anchor.
# to.
# transform.
# type.
# values.
# vector-effect.
# version.
# viewBox.
 viewport-fill.
 - udom-traitaccess-205-t.svg
 - udom-traitaccess-206-t.svg
 viewport-fill-opacity.
 - udom-traitaccess-207-t.svg
# visibility.
# width.
# x.
# x1.
# x2.
 xlink:href.
 - udom-traitaccess-201-t.svg
# y.
# y1.
# y2.
# zoomAndPan.

A.8.13 Additional accessing rules

# (as above) test that TYPE_MISMATCH_ERR is thrown for getRGBColorTrait for non-colours.


# test getMatrixTrait on ref(svg) and 'none'.


# test that 'display' always deals with 'none' and 'inline'.


- test for animation/font element trait setting while in the document?

A.8.14 SVGElement

# test id attribute, for combinations of IDs and xml:ids.

A.8.15 SVGTimedElement

 test pausing and unpausing of elements
 - udom-svgtimedelement-201-t.svg
 - udom-svgtimedelement-202-t.svg
 - udom-svgtimedelement-203-t.svg
 - udom-svgtimedelement-204-t.svg
 - udom-svgtimedelement-205-t.svg
 - udom-svg-207-t.svg
 - udom-svg-208-t.svg
 - udom-svg-209-t.svg
 - udom-svg-210-t.svg
 - udom-svg-211-t.svg


# checking isPaused, also for the case of an element past its active duration.

A.8.16 SVGVisualMediaElement

- nothing to test.

A.8.17 TimeEvent

# test detail for repeatEvent events.

A.8.18 SVGGlobal

- ignore createConnection/createTimer for now?


 test gotoLocation, just navigates to a “success” page
- udom-glob-202-t.svg
- should also test an invalid document, and "".


# test document is the same as the current document.


- ignore parent?


# test binaryToString just with the encodings specified. @@ is it allowed to assume that ES strings are UTF-16? if so, a tricky test might be to decode a UCS-4 string containing Plane 1 characters, ensuring that the ES string results in surrogates.


# test binaryToString with an invalid sequence of octets in the given encoding.


# test stringToBinary, same tests as above.


 test for getURL.
 - udom-glob-204-t.svg
 - udom-svg-217-t.svg
 - udom-svg-218-t.svg


 test for postURL.
  - udom-glob-203-t.svg


 test parseXML with valid XML.
 - udom-svg-203-t.svg


# test parseXML with valid XML 1.1, invalid XML, namespace un-wellformed.


# test for parseXML, that ownerDocument is set appropriately, scripts are not executed, that XSLT is not applied. @@ tests for when contextDoc is and isn’t null, what’s the difference?

A.8.19 AsyncStatusCallback

# test that the operationComplete method is called in the getURL/postURL tests, and that the status object is given.

A.8.20 AysncURLStatus

# test success/contentType/content, according to what’s known about the resource that’s fetched as part of the test. Should test various encodings.