Debian Codegraph @

dojox/gfx/tests/test_switchTo.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <title>Test switchTo</title>
6 <style type="text/css">
7 @import "../../../dojo/resources/dojo.css";
8 @import "../../../dijit/tests/css/dijitTests.css";
9 </style>
10 <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true, async:0, gfxRenderer:'svg,canvas,vml', packageMap:[{name:'doh',location:'util/doh'}]"></script>
11 <script type="text/javascript">
12 require([
13 "doh/runner",
14 "dojo/ready",
15 "dojo/sniff",
16 "dojo/aspect",
17 "dojox/gfx",
18 "dojox/gfx/shape"],
19 function(doh, ready, has, aspect, gfx, gfxshape, svg, canvas){
20
21 ready(function(){
22 var surface, newRenderer;
23
24 doh.register("switchTo", [
25 {
26 name: "switchTo(object)",
27 timeout: 1000,
28 setUp: function(){
29 },
30 runTest: function(t){
31 if(gfx.renderer == "vml") return;
32 var r = gfx.renderer == "svg" ? "canvasWithEvents" : "svg";
33 require(["dojox/gfx/" + r], function(){});
34 gfx.switchTo(gfx[r]);
35 t.t(gfx.Surface === gfx[r].Surface, "Unexpected Surface type.");
36 t.t(gfx.renderer === r, "Unexpected renderer.");
37 }
38 },
39 {
40 name: "switchTo(string)",
41 timeout: 1000,
42 setUp: function(){
43 },
44 runTest: function(t){
45 if(gfx.renderer == "vml") return;
46 var r = gfx.renderer == "svg" ? "canvasWithEvents" : "svg";
47 require(["dojox/gfx/" + r], function(){});
48 gfx.switchTo(r);
49 t.t(gfx.Surface === gfx[r].Surface, "Unexpected Surface type.");
50 t.t(gfx.renderer === r, "Unexpected renderer.");
51 }
52 }
53 ]);
54 doh.run();
55 });
56 });
57 </script>
58 </head>
59 <body>
60 <div id="gfxObject" style="width: 500px; height: 500px;font-weight:bold;"></div>
61 </body>
62 </html>