~jstys-z/helioviewer.org/client5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Test loading a local HTML Document</title>
    <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
    <script language="JavaScript" type="text/javascript" src="../app/jsUnitCore.js"></script>
    <script language="JavaScript" type="text/javascript">

        var uri = 'tests/data/data.html';

        function setUpPage() {
            setUpPageStatus = 'running';
            top.testManager.documentLoader.callback = setUpPageComplete;
            top.testManager.documentLoader.load(uri);
        }

        function setUpPageComplete() {
            if (setUpPageStatus == 'running')
                setUpPageStatus = 'complete';
        }

        function testDocumentGetElementsByTagName() {
            assertEquals(setUpPageStatus, 'complete');
            var buffer = top.testManager.documentLoader.buffer();
            var elms = buffer.document.getElementsByTagName('P');
            assert('getElementsByTagName("P") returned is null', elms != null);
            assert('getElementsByTagName("P") is empty', elms.length > 0);
        }

    </script>
</head>

<body>
<h1>JsUnit Asynchronous Load Tests</h1>

<p>This page tests loading data documents asynchronously. To see them, take a look at the source.</p>
</body>
</html>