forked from xml3d/xml3d.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss-transforms.js
More file actions
46 lines (39 loc) · 1.36 KB
/
css-transforms.js
File metadata and controls
46 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module("CSS Transformations", {
setup : function() {
stop();
var that = this;
this.cb = function(e) {
ok(true, "Scene loaded");
that.doc = document.getElementById("xml3dframe").contentDocument;
start();
};
loadDocument("scenes/css-transforms.html"+window.location.search, this.cb);
},
teardown : function() {
var v = document.getElementById("xml3dframe");
v.removeEventListener("load", this.cb, true);
}
});
test("Static Transforms", 3, function() {
var xTest = this.doc.getElementById("xml3dTest"),
glTest = getContextForXml3DElement(xTest), hTest = getHandler(xTest);
var self = this;
var testStep = 0;
function onFrameDrawn(){
if(testStep == 0){
if( XML3DUnit.getPixelValue(glTest, 200, 100)[0] == 0) {
ok(false, "Nothing rendered at all");
return;
}
XML3DUnit.loadSceneTestImages(self.doc, "xml3dReference", "xml3dTest", function(refImage, testImage){
QUnit.imageEqual(refImage, testImage, "CSS-Tranform Render matches");
testStep++;
start();
});
}
}
xTest.addEventListener("framedrawn", onFrameDrawn);
this.doc.getElementById("rootGroup").visible = true;
hTest.draw();
stop();
});