3 function compareArrays(a, b) {
5 if (Array.isArray(a) && Array.isArray(b)) {
6 if (a.length === b.length) {
7 for (var i = 0, len = a.length; i < len; i++) {
8 if (Array.isArray(a[i])) {
9 if (Array.isArray(b[i])) {
10 if (!compareArrays(a[i], b[i])) {
17 if (typeof (a[i]) === "number") {
18 if (typeof (b[i]) !== "number") {
21 if (Math.abs(a[i]) > Math.abs(b[i]) + EPSILON ||
22 Math.abs(a[i]) < Math.abs(b[i]) - EPSILON) {
39 function collectByName(collection) {
40 var root = dali.stage.getRootLayer();
41 if (collection === undefined) {
44 var op = function(actor) {
46 collection[actor.name] = actor;
51 dali.debug.depthVisit(root, op, true);
56 function square(color, size) {
57 var a = dali.createSolidColorActor(color, 0, [0, 0, 0, 1], 0);
62 function threeSquares() {
63 var root = dali.stage.getRootLayer();
65 var a = square([1, 0, 0, 1], [200, 200, 0]);
67 a.position = [-100, 0, -20];
71 a = square([0, 1, 0, 1], [200, 200, 0]);
73 a.position = [0, -100, -10];
77 a = square([0, 0, 1, 1], [200, 200, 0]);
79 a.position = [0, -100, 0];
87 var root = dali.stage.getRootLayer();
88 var children = root.getChildren();
90 for (var i = 0, len = children.length; i < len; i++) {
91 root.remove(children[i]);
92 children[i].delete(); // delete the wrapper
94 // root.delete(); // wrapper
97 var loadDocument = function(url, f) {
98 var v = document.getElementById("daliframe");
99 QUnit.ok(v, "Found frame.");
100 v.addEventListener("load", f, true);