~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to lib/jsunit-2.2/tests/jsUnitTestLoadData.html

  • Committer: V. Keith Hughitt
  • Date: 2009-03-26 19:20:57 UTC
  • Revision ID: hughitt1@kore-20090326192057-u0x8rf8sf5lmmnwh
nightly build 03-26-2009: Using alpha-channel JPEG 2000 dataset

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<html>
 
3
<head>
 
4
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
    <title>Test loading a local HTML Document</title>
 
6
    <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
 
7
    <script language="JavaScript" type="text/javascript" src="../app/jsUnitCore.js"></script>
 
8
    <script language="JavaScript" type="text/javascript">
 
9
 
 
10
        var uri = 'tests/data/data.html';
 
11
 
 
12
        function setUpPage() {
 
13
            setUpPageStatus = 'running';
 
14
            top.testManager.documentLoader.callback = setUpPageComplete;
 
15
            top.testManager.documentLoader.load(uri);
 
16
        }
 
17
 
 
18
        function setUpPageComplete() {
 
19
            if (setUpPageStatus == 'running')
 
20
                setUpPageStatus = 'complete';
 
21
        }
 
22
 
 
23
        function testDocumentGetElementsByTagName() {
 
24
            assertEquals(setUpPageStatus, 'complete');
 
25
            var buffer = top.testManager.documentLoader.buffer();
 
26
            var elms = buffer.document.getElementsByTagName('P');
 
27
            assert('getElementsByTagName("P") returned is null', elms != null);
 
28
            assert('getElementsByTagName("P") is empty', elms.length > 0);
 
29
        }
 
30
 
 
31
    </script>
 
32
</head>
 
33
 
 
34
<body>
 
35
<h1>JsUnit Asynchronous Load Tests</h1>
 
36
 
 
37
<p>This page tests loading data documents asynchronously. To see them, take a look at the source.</p>
 
38
</body>
 
39
</html>