Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/resources/tracing/test_utils.js

Issue 8513009: Add TRACE_COUNTER support to about:tracing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview Helper functions for use in tracing tests.
7 */
8 cr.define('test_utils', function() {
9 function getJSON(url, cb) {
10 var req = new XMLHttpRequest();
11 req.open('GET', url, true);
12 req.onreadystatechange = function(aEvt) {
13 if (req.readyState == 4) {
14 window.setTimeout(function() {
15 if (req.status == 200) {
16 var resp = JSON.parse(req.responseText);
17 if (resp.traceEvents)
18 cb(resp.traceEvents);
19 else
20 cb(resp);
21 } else {
22 console.log('Failed to load ' + url);
23 }
24 }, 0);
25 }
26 };
27 req.send(null);
28 }
29 return {
30 getJSON: getJSON
31 };
32 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698