3 <title>Moonlight Test Page
</title>
5 <script type=
"text/xaml" id=
"xaml">
8 xmlns=
"http://schemas.microsoft.com/client/2007"
9 xmlns:
x=
"http://schemas.microsoft.com/winfx/2006/xaml" >
13 <script language=
"javascript" src=
"Silverlight.js"></script>
14 <script language=
"javascript">
19 function QueueTestReady ()
21 if (document
.body
== null) {
22 window
.setTimeout ("QueueTestReady ()", 100);
26 window
.setTimeout ("RunTest ()", 250);
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);
41 test_plugin
.LogResult (1);
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);
59 // Create plugin html.
62 if (navigator
.appVersion
.indexOf('MSIE') != -1) {
64 '<object id="_TestPlugin" width="0" height="0" ' +
65 'classid = "CLSID:596F7B43-899C-42F4-BF3C-B62BA99E73FF">' +
69 '<embed id="_TestPlugin" width="0" height="0" ' +
70 'type="application\/x-jolttest">' +
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");
86 test_plugin
.Connect ();
88 setTimeout ("connectPlugin ();", 50);
95 <embed type=
"application/x-silverlight"
98 id=
"_MoonlightControl" Source=
"#xaml" OnError=
"ErrorHandler"
99 style=
"position:absolute; left:0px; top:0px" >