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

Unified Diff: chrome/browser/resources/tracing/test_utils.js

Issue 10543144: Remove old tracing code now that it has moved to third_party. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/tracing/sorted_array_utils.js ('k') | chrome/browser/resources/tracing/tests.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/tracing/test_utils.js
diff --git a/chrome/browser/resources/tracing/test_utils.js b/chrome/browser/resources/tracing/test_utils.js
deleted file mode 100644
index d0a844c31124a83bc9e6e4fa9add875dbc544d91..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/tracing/test_utils.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview Helper functions for use in tracing tests.
- */
-
-
-/**
- * goog.testing.assertion's assertEquals tweaked to do equality-to-a-constant.
- * @param {*} a First value.
- * @param {*} b Second value.
- */
-function assertAlmostEquals(a, b) {
- _validateArguments(2, arguments);
- var var1 = nonCommentArg(1, 2, arguments);
- var var2 = nonCommentArg(2, 2, arguments);
- _assert(commentArg(2, arguments), Math.abs(var1 - var2) < 0.00001,
- 'Expected ' + _displayStringForValue(var1) + ' but was ' +
- _displayStringForValue(var2));
-}
-
-cr.define('test_utils', function() {
- function getAsync(url, cb) {
- var req = new XMLHttpRequest();
- req.open('GET', url, true);
- req.onreadystatechange = function(aEvt) {
- if (req.readyState == 4) {
- window.setTimeout(function() {
- if (req.status == 200) {
- cb(req.responseText);
- } else {
- console.log('Failed to load ' + url);
- }
- }, 0);
- }
- };
- req.send(null);
- }
-
- function newAsyncSlice(start, duration, startThread, endThread) {
- return newAsyncSliceNamed('a', start, duration, startThread, endThread);
- }
-
- function newAsyncSliceNamed(name, start, duration, startThread, endThread) {
- var s = new tracing.TimelineAsyncSlice(name, 0, start);
- s.duration = duration;
- s.startThread = startThread;
- s.endThread = endThread;
- var subSlice = new tracing.TimelineAsyncSlice(name, 0, start);
- subSlice.duration = duration;
- subSlice.startThread = startThread;
- subSlice.endThread = endThread;
- s.subSlices = [subSlice];
- return s;
- }
-
- function assertArrayishEquals(ref, val) {
- assertEquals(ref.length, val.length);
- for (var i = 0; i < ref.length; i++)
- assertEquals(ref[i], val[i]);
- }
-
-
- return {
- getAsync: getAsync,
- newAsyncSlice: newAsyncSlice,
- newAsyncSliceNamed: newAsyncSliceNamed,
- assertArrayishEquals: assertArrayishEquals
- };
-});
« no previous file with comments | « chrome/browser/resources/tracing/sorted_array_utils.js ('k') | chrome/browser/resources/tracing/tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698