]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Tests for fo:wrapper.
authorJeremias Maerki <jeremias@apache.org>
Wed, 3 Aug 2005 18:42:24 +0000 (18:42 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 3 Aug 2005 18:42:24 +0000 (18:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@227246 13f79535-47bb-0310-9956-ffa450edef68

test/layoutengine/testcases/wrapper1.xml [new file with mode: 0644]
test/layoutengine/testcases/wrapper2.xml [new file with mode: 0644]

diff --git a/test/layoutengine/testcases/wrapper1.xml b/test/layoutengine/testcases/wrapper1.xml
new file mode 100644 (file)
index 0000000..963a8e7
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  Copyright 2005 The Apache Software Foundation\r
+\r
+  Licensed under the Apache License, Version 2.0 (the "License");\r
+  you may not use this file except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+<!-- $Id$ -->\r
+<testcase>\r
+  <info>\r
+    <p>\r
+      This test checks fo:wrapper.\r
+    </p>\r
+  </info>\r
+  <fo>\r
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">\r
+      <fo:layout-master-set>\r
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">\r
+          <fo:region-body/>\r
+        </fo:simple-page-master>\r
+      </fo:layout-master-set>\r
+      <fo:page-sequence master-reference="normal">\r
+        <fo:flow flow-name="xsl-region-body">\r
+          <fo:block>block content <fo:wrapper font-style="italic" color="red">inline-level stuff inside wrapper on page <fo:page-number/></fo:wrapper> wrapper is finished.</fo:block>\r
+        </fo:flow>\r
+      </fo:page-sequence>\r
+    </fo:root>\r
+  </fo>\r
+  <checks>\r
+    <eval expected="2" xpath="count(//flow/block/lineArea)"/>\r
+    <eval expected="4" xpath="count(//flow/block/lineArea[1]/text)"/>\r
+    <eval expected="14400" xpath="//flow/block/lineArea[1]/@bpda"/>\r
+    <eval expected="#000000" xpath="//flow/block/lineArea[1]/text[1]/@color"/>\r
+    <eval expected="#ff0000" xpath="//flow/block/lineArea[1]/text[2]/@color"/>\r
+    <eval expected="#ff0000" xpath="//flow/block/lineArea[1]/text[3]/@color"/>\r
+    <eval expected="#000000" xpath="//flow/block/lineArea[1]/text[4]/@color"/>\r
+    <eval expected="1" xpath="//flow/block/lineArea[1]/text[3]"/>\r
+  </checks>\r
+</testcase>\r
diff --git a/test/layoutengine/testcases/wrapper2.xml b/test/layoutengine/testcases/wrapper2.xml
new file mode 100644 (file)
index 0000000..228cb3a
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  Copyright 2005 The Apache Software Foundation\r
+\r
+  Licensed under the Apache License, Version 2.0 (the "License");\r
+  you may not use this file except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+<!-- $Id$ -->\r
+<testcase>\r
+  <info>\r
+    <p>\r
+      This test checks fo:wrapper with block-level content.\r
+    </p>\r
+  </info>\r
+  <fo>\r
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">\r
+      <fo:layout-master-set>\r
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">\r
+          <fo:region-body/>\r
+        </fo:simple-page-master>\r
+      </fo:layout-master-set>\r
+      <fo:page-sequence master-reference="normal">\r
+        <fo:flow flow-name="xsl-region-body">\r
+          <fo:block>block content <fo:wrapper color="red">inline<fo:block>a block inside the wrapper</fo:block>inline</fo:wrapper> wrapper is finished.</fo:block>\r
+        </fo:flow>\r
+      </fo:page-sequence>\r
+    </fo:root>\r
+  </fo>\r
+  <checks>\r
+    <!-- Just check if this really results in 3 lines. -->\r
+    <element-list category="breaker">\r
+      <box w="14400"/>\r
+      <penalty w="0" p="0"/>\r
+      <box w="14400"/>\r
+      <penalty w="0" p="0"/>\r
+      <box w="14400"/>\r
+      <skip>3</skip>\r
+    </element-list>\r
+    <eval expected="3" xpath="count(//lineArea)"/>\r
+    <eval expected="2" xpath="count(//flow/block/*[1]/text)"/>\r
+    <eval expected="1" xpath="count(//flow/block/*[2]/lineArea/text)"/>\r
+    <eval expected="2" xpath="count(//flow/block/*[3]/text)"/>\r
+    <eval expected="#000000" xpath="//flow/block/lineArea[1]/text[1]/@color"/>\r
+    <eval expected="#ff0000" xpath="//flow/block/lineArea[1]/text[2]/@color"/>\r
+    <eval expected="#ff0000" xpath="//flow/block/block[1]/lineArea/text[1]/@color"/>\r
+    <eval expected="#ff0000" xpath="//flow/block/lineArea[2]/text[1]/@color"/>\r
+    <eval expected="#000000" xpath="//flow/block/lineArea[2]/text[2]/@color"/>\r
+  </checks>\r
+</testcase>\r