1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <title>Test file
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <script src=
"../js/js/utils.js"></script>
8 <script src=
"../js/js/testplugin.js"></script>
12 <script type=
"text/xaml" id=
"xamlA">
13 <Canvas xmlns=
"http://schemas.microsoft.com/client/2007" xmlns:
x=
"http://schemas.microsoft.com/winfx/2006/xaml"
14 Loaded=
"OnCanvasLoaded"
15 Height=
"200" Width=
"200"
19 <script type=
"text/javascript">
20 var last_progress
= 0;
22 function OnCanvasLoaded (sender
, args
)
24 TestLogger
.LogDebug ("OnCanvasLoaded");
25 plugin
= document
.getElementById ("JoltActiveX");
26 dl
= plugin
.createObject ("Downloader");
29 dl
.Open ("GET", "../media/video/timecode.mpeg");
30 dl
.AddEventListener ("Completed", "OnDownloadCompleted");
31 dl
.AddEventListener ("DownloadProgressChanged", "OnDownloadProgressChanged");
32 dl
.AddEventListener ("DownloadFailed", "OnDownloadFailed");
36 function OnDownloadFailed (sender
, args
)
38 Fail ("OnDownloadFailed: " + ErrorEventArgsToOneLineString (args
));
41 function OnDownloadProgressChanged (sender
, args
)
43 TestLogger
.LogDebug("OnDownloadProgressChanged: " + sender
.DownloadProgress
+ " (last progress: " + last_progress
+ ")");
44 // Test that download progress doesn't go down.
45 if (last_progress
> sender
.DownloadProgress
)
46 Fail ("Current progress: " + sender
.DownloadProgress
+ " is less than last progress: " + last_progress
);
47 last_progress
= sender
.DownloadProgress
;
50 function OnDownloadCompleted (sender
, args
)
52 TestLogger
.LogDebug ("OnDownloadComplete");
53 if (!ShutdownRequested
) {
54 TestLogger
.LogResult (1);
59 function OnPluginError (sender
, args
)
61 Fail ("OnPluginError: " + ErrorEventArgsToOneLineString (args
));
66 TestLogger
.LogError (msg
);
67 TestLogger
.LogResult (-1)
75 <embed type=
"application/x-silverlight" width=
"300" height=
"300"
76 id=
"JoltActiveX" Source=
"#xamlA" OnError=
"OnPluginError" OnLoad=
"OnPluginLoaded"
77 style=
"position:absolute; left:0px; top:0px" background=
"#CCCCCC">
82 <embed id="_TestPlugin" width="0" height="0" type="application/x-jolttest"