Techniques Used for Testing of HTML, SVG, WMF/EMF Formats Toma - - PowerPoint PPT Presentation

techniques used for testing of html svg wmf emf formats
SMART_READER_LITE
LIVE PREVIEW

Techniques Used for Testing of HTML, SVG, WMF/EMF Formats Toma - - PowerPoint PPT Presentation

Techniques Used for Testing of HTML, SVG, WMF/EMF Formats Toma Vajngerl <tomaz.vajngerl@collabora.com> quikee, #libreoffice-dev, irc.freenode.net T esting of OOXML and ODF Import, export, roundtrip At import assert the model


slide-1
SLIDE 1

Techniques Used for Testing of HTML, SVG, WMF/EMF Formats

Tomaž Vajngerl <tomaz.vajngerl@collabora.com> quikee, #libreoffice-dev, irc.freenode.net

slide-2
SLIDE 2

T esting of OOXML and ODF

  • Import, export, roundtrip
  • At import assert the model state
  • At export test, import and assert the

model state..

  • ..or assert the state of the exported

document

slide-3
SLIDE 3

OOXML, ODF - Assert exported document

  • Document is a ZIP container, parts are

XML fjles

  • Easiest to use xpath to assert the

desired values in the XML fjle

slide-4
SLIDE 4

assertXPath (pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rP r/w14:textOutline", "algn", "ctr");

slide-5
SLIDE 5

T esting HTML export

  • HTML is not XML
  • Luckily libxml2 also supports HTML so

can just use xpath

slide-6
SLIDE 6

T esting HTML export (2)

  • Calc: sc/qa/extras/htmlexporttest.cxx
  • Draw: sd/qa/unit/HtmlExportT

est.cxx

  • Writer:

sw/qa/extras/htmlexport/htmlexport.cxx

slide-7
SLIDE 7

WMF and EMF

  • Windows Meta File / Enhanced Meta

File

  • vector graphic format
  • Recording of drawing commands to

GDI/GDI+

slide-8
SLIDE 8

T esting WMF and EMF

  • Import fjlter transforms a WMF/EMF to

a MTF (GDIMetaFile / Star View Metafjle)

  • Problem - how to know if the problem

is in rendering or in transformation and what the result of the transformation is?

slide-9
SLIDE 9

T esting WMF and EMF (2)

  • Idea – transform MTF into XML

representation (for testing and debugging purposes)

  • This makes it possible to:
  • inspect values
  • assert the values with xpath
slide-10
SLIDE 10

T esting WMF and EMF (3)

  • MetafjleXmlDump [1]
  • Additional ability to fjlter commands
  • Used by WmfT

est in VCL [2]

  • Not all commands supported – feel

free to extend it!

[1] /test/source/mtfxmldump.cxx [2] vcl/qa/cppunit/wmf/wmfjmporttest.cxx

slide-11
SLIDE 11

EMF+?

  • EMF+ has additional commands which

are not supported by MTF

  • Converts to MTF but EMF+ commands

are transported as MTF comments

  • cppcanvas renders the MTF instead of

drawinglayer

  • We should get rid of this
slide-12
SLIDE 12

Scalable Vector Graphic (SVG)

  • Is “just” XML – easy to test export
  • At import a Primitive2DSequence is

created – how to test that?

  • Rendered then by drawinglayer
slide-13
SLIDE 13

Scalable Vector Graphic (SVG)

  • Similar approach as with MTF –

transform Primitive2DSequence into XML and test that

  • Primitive2dXmlDump [1]
  • Used by tests in SVG fjlter (svgio) [2]

[1] /test/source/primitive2dxmldump.cxx [2] /svgio/qa/cppunit/SvgImportT est.cxx