summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/trace-viewer/src/tests.html
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/trace-viewer/src/tests.html')
-rw-r--r--chromium/third_party/trace-viewer/src/tests.html178
1 files changed, 0 insertions, 178 deletions
diff --git a/chromium/third_party/trace-viewer/src/tests.html b/chromium/third_party/trace-viewer/src/tests.html
deleted file mode 100644
index 2f8d09fc75d..00000000000
--- a/chromium/third_party/trace-viewer/src/tests.html
+++ /dev/null
@@ -1,178 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-Copyright (c) 2013 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.
--->
-<head>
- <title>All Tracing Tests</title>
- <script src="/src/base.js"></script>
- <script>
- base.require('base.unittest');
- base.require('base.settings');
- </script>
- <link rel="shortcut icon" href="data:image/x-icon;base64," type="image/x-icon">
- <script>
- 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 launchTests(suite, tests, testType) {
- var stats = document.getElementById('stats');
- base.unittest.testType(testType);
-
- // Perf tests should never have condensed results.
- if (testType === 'perf') {
- base.unittest.showCondensed(false);
- } else {
- var val = localStorage.getItem('testing::short-format') === 'true';
- base.unittest.showCondensed(val);
- }
-
- if (suite !== undefined) {
- base.unittest.Suites(['/src/' + suite + '_test.js'], tests);
- } else {
- getAsync('/json/tests', function(data) {
- base.unittest.Suites(JSON.parse(data), tests);
- });
- }
- }
-
- function launchTestsIfAvailable() {
- if (base.unittest === undefined ||
- base.unittest.showCondensed === undefined ||
- base.unittest.testType === undefined) {
- window.setTimeout(launchTestsIfAvailable, 100);
- return;
- }
-
- var suite = undefined;
- var tests = [];
- var testType = 'unit';
-
- // Note, this is nieve, but works for our purposes. Would explode on
- // encoded &'s.
- var queryParams = window.location.search.substring(1).split('&');
- queryParams.forEach(function(param) {
- var parts = param.split('=');
- if (parts[0] === 'suite')
- suite = parts[1];
- else if (parts[0] === 'test')
- tests.push(parts[1]);
- else if (parts[0] === 'type')
- testType = (parts[1] === 'perf' ? 'perf' : 'unit');
- });
-
- var format = document.getElementById('short-format');
- format.checked = localStorage.getItem('testing::short-format') === 'true';
- format.addEventListener('click', function(ev) {
- localStorage.setItem('testing::short-format', ev.target.checked);
-
- if (testType === 'perf')
- return;
-
- base.unittest.showCondensed(ev.target.checked);
- base.unittest.runSuites();
- });
- base.unittest.showCondensed(format.checked);
-
- var testTypeInputs = document.getElementsByName('test-type');
- for (var i = 0; i < testTypeInputs.length; ++i) {
- if (testTypeInputs[i].value === testType)
- testTypeInputs[i].checked = true;
-
- testTypeInputs[i].addEventListener('click', function(ev) {
- testType = ev.target.value;
-
- var loc = window.location.protocol + '//' + window.location.host +
- window.location.pathname + '?';
-
- if (suite !== undefined)
- loc += 'suite=' + suite + '&';
- if (tests.length !== 0)
- loc += 'test=' + tests.join(',') + '&';
- loc += 'type=' + testType;
-
- window.location = loc;
- return;
- });
- }
- launchTests(suite, tests, testType);
- }
-
- document.addEventListener('DOMContentLoaded', function() {
- launchTestsIfAvailable();
- });
-
- </script>
- <style>
- html, body {
- box-sizing: border-box;
- width: 100%;
- height: 100%;
- overflow: hidden;
- margin: 0;
- }
- </style>
-</head>
-
-<body>
- <div id="test-harness">
- <h1><a href='/src/tests.html'>Trace-Viewer Tests</a></h1>
-
- <div id="stats">
- <br />
- </div>
-
- <div id='individual-tests'>
- <div class="unittest">
- View a trace file:
- <a href="/examples/trace_viewer.html"
- class="unittest-error-link">Trace viewer</a>
- </div>
- <div class="unittest">
- View a skp file:
- <a href="/examples/skia_debugger.html"
- class="unittest-error-link">Skia Debugger</a>
- </div>
- <div class="unittest">
- <input type="radio" name="test-type" value="unit" />
- Run unit tests
-
- <input type="radio" name="test-type" value="perf" />
- Run perf tests
- </div>
- <div class="unittest">
- <input type="checkbox" id="short-format" /> Short format
- </div>
- </div>
-
- <div id='messages'>
- <h1>Warning</h1>
- <ul id='message-list'></ul>
- </div>
-
- <div id='test-results'>
- </div>
-
- <div id='exceptions'>
- <h1>Exceptions</h1>
- <ol id="exception-list"></ol>
- </div>
- </div>
-</body>
-</html>