2150 |
mathias |
1 |
<html>
|
|
|
2 |
<head>
|
|
|
3 |
<title>Test colors</title>
|
|
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
5 |
<style type="text/css">
|
|
|
6 |
@import "../../../dojo/resources/dojo.css";
|
|
|
7 |
@import "../../../dijit/tests/css/dijitTests.css";
|
|
|
8 |
|
|
|
9 |
.pane { margin-top: 2em; }
|
|
|
10 |
</style>
|
|
|
11 |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
|
|
|
12 |
<script type="text/javascript" src="colors2.js"></script>
|
|
|
13 |
<script type="text/javascript">
|
|
|
14 |
dojo.require("dojox.encoding.tests.colors");
|
|
|
15 |
//dojo.require("dojox.encoding.tests.colors2");
|
|
|
16 |
dojo.require("dojox.encoding.tests.colors3");
|
|
|
17 |
var dct = dojox.encoding.tests;
|
|
|
18 |
|
|
|
19 |
var test = function(c1, c2, result){
|
|
|
20 |
var empty = {};
|
|
|
21 |
for(var i in c1){
|
|
|
22 |
if(i in empty){ continue; }
|
|
|
23 |
if(!(i in c2)){
|
|
|
24 |
result.push("<div>" + i + " is missing.</div>");
|
|
|
25 |
continue;
|
|
|
26 |
}
|
|
|
27 |
var v1 = c1[i], v2 = c2[i];
|
|
|
28 |
if(v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]){
|
|
|
29 |
result.push("<div>" + i + " doesn't match.</div>");
|
|
|
30 |
continue;
|
|
|
31 |
}
|
|
|
32 |
result.push("<div style='color: green'>" + i + " is ok.</div>");
|
|
|
33 |
}
|
|
|
34 |
};
|
|
|
35 |
|
|
|
36 |
var run = function(){
|
|
|
37 |
var result = [];
|
|
|
38 |
result.push("<p><strong>Comparing colors to colors3.</strong></p>");
|
|
|
39 |
test(dct.colors, dct.colors3, result);
|
|
|
40 |
result.push("<p><strong>Comparing colors3 to colors.</strong></p>");
|
|
|
41 |
test(dct.colors3, dct.colors, result);
|
|
|
42 |
/*
|
|
|
43 |
result.push("<p><strong>Comparing colors to colors2.</strong></p>");
|
|
|
44 |
test(dct.colors, dct.colors2, result);
|
|
|
45 |
result.push("<p><strong>Comparing colors2 to colors.</strong></p>");
|
|
|
46 |
test(dct.colors2, dct.colors, result);
|
|
|
47 |
*/
|
|
|
48 |
dojo.byId("status").innerHTML = result.join("\n");
|
|
|
49 |
};
|
|
|
50 |
|
|
|
51 |
dojo.addOnLoad(function(){
|
|
|
52 |
dojo.connect(dojo.byId("run"), "onclick", run);
|
|
|
53 |
});
|
|
|
54 |
</script>
|
|
|
55 |
</head>
|
|
|
56 |
<body>
|
|
|
57 |
<h1>Test colors</h1>
|
|
|
58 |
<p><button id="run">Run</button></p>
|
|
|
59 |
<div id="status" class="pane"><em>No status yet.</em></div>
|
|
|
60 |
</body>
|
|
|
61 |
</html>
|