cb9e2f19552c7472dbb5f24355b9e77fc83a40ff
[dygraphs.git] / auto_tests / misc / local.html
1 <!-- A local source file that allows dygraph developers to test locally. -->
2 <html>
3 <head>
4 <!-- Standard Dygraph scripts -->
5 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
6 <!--[if IE]>
7 <script type="text/javascript" src="../../excanvas.js"></script>
8 <![endif]-->
9 <script type="text/javascript" src="../../dygraph-dev.js"></script>
10
11 <!-- Scripts for automated tests -->
12 <script type="text/javascript" src="../lib/jquery-1.4.2.js"></script>
13 <script type="text/javascript" src="../lib/Asserts.js"></script>
14 <script type="text/javascript" src="fake-jstestdriver.js"></script>
15 <script type="text/javascript" src="../tests/Proxy.js"></script>
16 <script type="text/javascript" src="../tests/CanvasAssertions.js"></script>
17 <script type="text/javascript" src="../tests/DygraphOps.js"></script>
18 <script type="text/javascript" src="../tests/sanity.js"></script>
19 <script type="text/javascript" src="../tests/simple_drawing.js"></script>
20 <script type="text/javascript" src="../tests/range_tests.js"></script>
21 <script type="text/javascript" src="../tests/axis_labels.js"></script>
22 <script type="text/javascript" src="../tests/multi_csv.js"></script>
23 <script type="text/javascript" src="../tests/to_dom_coords.js"></script>
24 <script type="text/javascript" src="../tests/interaction_model.js"></script>
25 <!--
26 <script type="text/javascript" src="../tests/tickers.js"></script>
27 -->
28 <script type="text/javascript" src="../tests/scrolling_div.js"></script>
29 <script type="text/javascript" src="../tests/custom_bars.js"></script>
30 <script type="text/javascript" src="../tests/css.js"></script>
31 <script type="text/javascript" src="../tests/selection.js"></script>
32 <script type="text/javascript" src="../tests/rolling_average.js"></script>
33 <script type="text/javascript" src="../tests/error_bars.js"></script>
34 <script type="text/javascript" src="../tests/annotations.js"></script>
35 <script type="text/javascript" src="../tests/scientific_notation.js"></script>
36 <script type="text/javascript" src="../tests/pathological_cases.js"></script>
37 <script type="text/javascript" src="../tests/update_options.js"></script>
38 <script type="text/javascript" src="../tests/utils_test.js"></script>
39 <script type="text/javascript" src="../tests/multiple_axes.js"></script>
40
41
42 <script type="text/javascript">
43 var tc = null;
44 function processVariables() {
45 var splitVariables = function() { // http://www.idealog.us/2006/06/javascript_to_p.html
46 var query = window.location.search.substring(1);
47 var args = {};
48 var vars = query.split("&");
49 for (var i = 0;i < vars.length; i++) {
50 var pair = vars[i].split("=");
51 args[pair[0]] = pair[1];
52 }
53 return args;
54 }
55
56 var args = splitVariables();
57 var test = args.test;
58 var command = args.command;
59
60 if (args.testCase) {
61 eval("tc = new " + args.testCase + "()");
62 if (args.command) {
63 if (args.command == "runAllTests") {
64 console.log("Running all tests for " + args.testCase);
65 tc.runAllTests();
66 }
67 if (args.command == "runTest") {
68 console.log("Running test " + args.testCase + "." + args.test);
69 tc.runTest(args.test);
70 }
71 }
72 }
73 }
74 </script>
75 </head>
76 <body>
77 <div id='graph'></div>
78 <p>This file is really nothing more than all the tests coalesced into a single
79 HTML file. To run a test, open a Javascript console and execute, for
80 instance,</p>
81 <code>testDrawSimpleRangePlusOne()</code>
82
83 <p>Alternatively you can use query args: <ul>
84 <li>testCase - for the name of the test case
85 <li>test - for the name of the test (use command=runTest)
86 <li>command - either runTest or runAllTests.
87 </ul>
88 Example: <code>local.html?testCase=ScrollingDivTestCase&test=testNestedDiv_Scrolled&command=runTest</code>
89 </body>
90 <script>
91 processVariables();
92 addGlobalTestSymbols();
93 </script>
94 </html>