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

Unified Diff: third_party/WebKit/LayoutTests/fast/svg/svglist.html

Issue 2118903003: Relocate tests from fast/svg/ to svg/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-fast-svg-tests
Patch Set: Rename some files Created 4 years, 6 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: third_party/WebKit/LayoutTests/fast/svg/svglist.html
diff --git a/third_party/WebKit/LayoutTests/fast/svg/svglist.html b/third_party/WebKit/LayoutTests/fast/svg/svglist.html
deleted file mode 100644
index 6ff3e76bbe794dd4178a44ff97f37eca0d773b0b..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/svg/svglist.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!doctype html>
-<title>SVG*List array method tests</title>
-<script src=../../resources/testharness.js></script>
-<script src=../../resources/testharnessreport.js></script>
-<div id="testcontainer"></div>
-<div id=log></div>
-<script>
-function createSvg() {
- document.getElementById("testcontainer").innerHTML = '<svg id="svg" width="1" height="1" visibility="hidden"><polygon id="polygon" points="10 10 450 212 24 103 45 32 62 42 123 52 62 52 57 72 12 548 85 12" visibility="hidden" systemLanguage="sv, en, fr, de, zn, jp"/><path id="path" d="M 10 10 L 450 212 24 103 45 32 62 42 123 52 62 52 57 72 12 548 85 12" transform="scale(0.5) rotate(34) translate(10 10)" visibility="hidden"/><text id="text" dx="10 10 450 212 24 103 45 32 62 42 123 52 62 52 57 72 12 548 85 12" rotate="10 66 2 23 546 54657 567 546 3 2 2 2 23" visibility="hidden"/></svg>';
-}
-setup(createSvg);
-var svg = document.getElementById("svg");
-var polygon = document.getElementById("polygon");
-var path = document.getElementById("path");
-var text = document.getElementById("text");
-function createSVGPoint(x,y) {
- var o;
- try {
- o = new SVGPoint(x,y);
- }
- catch(e) {
- o = svg.createSVGPoint();
- o.x = x;
- o.y = y;
- }
- return o;
-}
-function createSVGLength(value) {
- var o;
- try {
- o = new SVGLength(value);
- }
- catch(e) {
- o = svg.createSVGLength();
- o.value = value;
- }
- return o;
-}
-function createSVGNumber(value) {
- var o;
- try {
- o = new SVGNumber(value);
- }
- catch(e) {
- o = svg.createSVGNumber();
- o.value = value;
- }
- return o;
-}
-function createSVGTransformTranslate(tx,ty) {
- var o;
- try {
- o = new SVGTransform();
- }
- catch(e) {
- o = svg.createSVGTransform();
- }
- o.setTranslate(tx, ty);
- return o;
-}
-var lists = {
- "SVGPointList":
- { "impl": polygon.points,
- "type": "SVGPoint",
- "length": 10,
- "insert_value": createSVGPoint(5, 5),
- "equals": function(a,b) { return a.x == b.x && a.y == b.y; }
- },
- "SVGStringList":
- { "impl": polygon.systemLanguage,
- "type": "DOMString",
- "length": 6,
- "insert_value": "uk",
- "equals": function(a,b) { return a == b; }
- },
- "SVGTransformList":
- { "impl": path.transform.baseVal,
- "type": "SVGTransform",
- "length": 3,
- "insert_value": createSVGTransformTranslate(5,5),
- "equals": function(a,b) { return a.matrix.a == b.matrix.a &&
- a.matrix.b == b.matrix.b &&
- a.matrix.c == b.matrix.c &&
- a.matrix.d == b.matrix.d &&
- a.matrix.e == b.matrix.e &&
- a.matrix.f == b.matrix.f; }
- },
- "SVGLengthList":
- { "impl": text.dx.baseVal,
- "type": "SVGLength",
- "length": 20,
- "insert_value": createSVGLength(5),
- "equals": function(a,b) { return a.valueInSpecifiedUnits == b.valueInSpecifiedUnits &&
- a.unitType == b.unitType; }
- },
- "SVGNumberList":
- { "impl": text.rotate.baseVal,
- "type": "SVGNumber",
- "length": 13,
- "insert_value": createSVGNumber(5),
- "equals": function(a,b) { return a.value == b.value; }
- }
-};
-
-for (list_type in lists) {
- test(function() {
- assert_idl_attribute(lists[list_type].impl, "length");
- }, list_type + " has length attribute");
- test(function() {
- assert_idl_attribute(lists[list_type].impl, "numberOfItems");
- }, list_type + " has numberOfItems attribute");
- test(function() {
- assert_equals(lists[list_type].impl.length, lists[list_type].impl.numberOfItems);
- assert_equals(lists[list_type].impl.length, lists[list_type].length);
- }, list_type + ".length equals " + list_type + ".numberOfItems.");
- test(function() {
- assert_true(lists[list_type].equals(lists[list_type].impl.getItem(0), lists[list_type].impl[0]));
- }, list_type + " has array getter");
- test(function() {
- var old_value = lists[list_type].impl[0];
- var new_value = lists[list_type].insert_value;
- lists[list_type].impl[0] = lists[list_type].insert_value;
- assert_false(lists[list_type].equals(old_value, new_value));
- assert_true(lists[list_type].equals(lists[list_type].impl[0], new_value));
- assert_equals(lists[list_type].impl.length, lists[list_type].length);
- }, list_type + " has array setter");
-}
-
-</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/svg/svglength.html ('k') | third_party/WebKit/LayoutTests/fast/svg/tabindex-focus.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698