OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <!-- |
| 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 5 Use of this source code is governed by a BSD-style license that can be |
| 6 found in the LICENSE file. |
| 7 --> |
| 8 <head i18n-values="dir:textdirection;"> |
| 9 <title>Interactive Timeline Tests</title> |
| 10 <script src="base.js"></script> |
| 11 </head> |
| 12 <body> |
| 13 <div class="timeline-test" src="../test_data/trivial_trace.json" create-detach
ed=1> |
| 14 </div> |
| 15 |
| 16 <script> |
| 17 function reqAsync(method, path, data, opt_response_cb, opt_err_cb) { |
| 18 if (path[0] != '/') |
| 19 throw new Error('Must start with /'); |
| 20 var req = new XMLHttpRequest(); |
| 21 req.open(method, BASE_URL + path, true); |
| 22 req.addEventListener('load', function() { |
| 23 if (req.status == 200) { |
| 24 if (opt_response_cb) |
| 25 opt_response_cb(JSON.parse(req.responseText)); |
| 26 return; |
| 27 } |
| 28 if (opt_err_cb) |
| 29 opt_err_cb(); |
| 30 else |
| 31 console.log('reqAsync ' + path, req); |
| 32 }); |
| 33 req.addEventListener('error', function() { |
| 34 if (opt_err_cb) |
| 35 opt_err_cb(); |
| 36 else |
| 37 console.log('reqAsync ' + path, req); |
| 38 }); |
| 39 if (data) |
| 40 req.send(JSON.stringify(data)); |
| 41 else |
| 42 req.send(null); |
| 43 } |
| 44 </script> |
| 45 |
| 46 </body> |
OLD | NEW |