* MoonlightTypeConverter.cs: Convert CacheMode's from strings.
[moon.git] / test / xaml / test-create-resources.html
blob1ae19ddf43a7601695470b607d2ec6c804d54728
1 <html>
2 <head>
3 <title>Moonlight Test Page</title>
5 <script type="text/xaml" id="xaml">
6 <?xml version="1.0"?>
7 <Canvas
8 xmlns="http://schemas.microsoft.com/client/2007"
9 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
10 </Canvas>
11 </script>
13 <script language="javascript" src="Silverlight.js"></script>
14 <script language="javascript">
16 createTestPlugin ();
17 QueueTestReady ();
19 function QueueTestReady ()
21 if (document.body == null) {
22 window.setTimeout ("QueueTestReady ()", 100);
23 return;
26 window.setTimeout ("RunTest ()", 250);
29 function RunTest ()
31 var control = document.getElementById ("_MoonlightControl");
32 var test_plugin = document.getElementById ("_TestPlugin");
34 var dic = control.content.createFromXaml ("<Canvas.Resources></Canvas.Resources>");
35 if (dic.toString () != "ResourceDictionary") {
36 test_plugin.LogError ("Return value was of incorrect type " + dic);
37 test_plugin.LogResult (-1);
38 return;
41 test_plugin.LogResult (1);
43 FinishTest ();
46 function FinishTest ()
48 var test_plugin = document.getElementById ("_TestPlugin");
49 test_plugin.SignalShutdown (document.name);
52 function createTestPlugin ()
54 if (document.body == null) {
55 window.setTimeout("createTestPlugin ();", 10);
56 return;
59 // Create plugin html.
60 var pluginHtml = "";
62 if (navigator.appVersion.indexOf('MSIE') != -1) {
63 pluginHtml =
64 '<object id="_TestPlugin" width="0" height="0" ' +
65 'classid = "CLSID:596F7B43-899C-42F4-BF3C-B62BA99E73FF">' +
66 '<\/object>';
67 } else {
68 pluginHtml =
69 '<embed id="_TestPlugin" width="0" height="0" ' +
70 'type="application\/x-jolttest">' +
71 '<\/embed>';
74 // Insert plugin html into document.
75 var obj = document.createElement ("DIV");
76 obj.innerHTML = pluginHtml;
77 document.body.appendChild (obj);
79 setTimeout ("connectPlugin ();", 50);
82 function connectPlugin ()
84 var test_plugin = document.getElementById ("_TestPlugin");
85 if (test_plugin) {
86 test_plugin.Connect ();
87 } else {
88 setTimeout ("connectPlugin ();", 50);
91 </script>
92 </head>
94 <body>
95 <embed type="application/x-silverlight"
96 width="10"
97 height="10"
98 id="_MoonlightControl" Source="#xaml" OnError="ErrorHandler"
99 style="position:absolute; left:0px; top:0px" >
100 </embed>
101 </body>
102 </html>