summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/Console.html
blob: 48b27c2a6d2bc9103664c9a55427e4968c71ca39 (plain)
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
<html>
<head>
  <script src="OLLoader.js"></script>
  <script type="text/javascript">
    function test_Console(t) {
        
        /**
         * These tests only assure that OpenLayers works when not
         * in debug mode.  It means that calls to OpenLayers.Console
         * will not do anything in this case.  When OpenLayers is in
         * debug mode, we assume that the Firebug extension or Firebug Lite
         * works as advertised.
         */
        
        // supported OpenLayers.Console methods
        var methods = ['log', 'debug', 'info', 'warn', 'error', 'assert',
               'dir', 'dirxml', 'trace', 'group', 'groupEnd', 'time',
               'timeEnd', 'profile', 'profileEnd', 'count'];

        t.plan(methods.length * 2);

        var nothing, method;
        for(var i=0; i<methods.length; ++i) {
            method = OpenLayers.Console[methods[i]];
            t.ok(method,
                 "OpenLayers.Console." + methods[i] + " exists");
            nothing = OpenLayers.Console[methods[i]]();
            t.eq(nothing, null,
                 "OpenLayers.Console." + methods[i] + "() " +
                 "call is harmless when not in debug mode");
        }

    }

  </script>
</head>
<body>
</body>
</html>