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

Unified Diff: tools/perf/metrics/chrome_proxy.js

Issue 397483002: Move chrome_proxy tests from under tools/perf to tools/chrome_proxy/integration_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments and sync'ed Created 6 years, 5 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 | « tools/perf/metrics/OWNERS ('k') | tools/perf/metrics/chrome_proxy.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/chrome_proxy.js
diff --git a/tools/perf/metrics/chrome_proxy.js b/tools/perf/metrics/chrome_proxy.js
deleted file mode 100644
index 63fc81fcaf2022f577b01ab213bc1a78b43fb5da..0000000000000000000000000000000000000000
--- a/tools/perf/metrics/chrome_proxy.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2014 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.
-
-// This file contains common utilities to find chrome proxy related elements on
-// a page and collect info from them.
-
-(function() {
- var PROXY_VIEW_ID = 'proxy-view-tab-content';
- var PROXY_VIEW_EFFECTIVE_SETTINGS_ID = 'proxy-view-effective-settings';
- var PROXY_VIEW_BAD_PROXIES_ID = 'proxy-view-bad-proxies-div';
- var PROXY_VIEW_BAD_PROXIES_TBODY = 'proxy-view-bad-proxies-tbody';
- var PRXOY_SETTINGS_PREFIX = 'Proxy server for HTTP: ['
- var PROXY_SETTINGS_SIGNATURE = 'proxy.googlezip.net:443, ' +
- 'compress.googlezip.net:80, direct://';
-
- // Returns the effective proxy in an array from settings.
- // An example of the settings is:
- // "Proxy server for HTTP: [proxy.googlezip.net:443, " +
- // "compress.googlezip.net:80, direct://]"
- function getEffectiveProxies(doc) {
- var settings = doc.getElementById(PROXY_VIEW_EFFECTIVE_SETTINGS_ID);
- if (settings && settings.innerHTML &&
- settings.innerHTML.indexOf(PRXOY_SETTINGS_PREFIX) == 0) {
- var left = settings.innerHTML.indexOf('[');
- var right = settings.innerHTML.indexOf(']');
- if (left >= 0 && right > left) {
- return settings.innerHTML.substring(left + 1, right).split(/[ ,]+/);
- }
- }
- return [];
- }
-
- // Returns an array of bad proxies. Each element is a bad proxy with
- // attribute 'proxy' as the proxy name and attribute 'retry' as the
- // next retry time.
- function getBadProxyList(doc) {
- var bad_proxies = doc.getElementById(PROXY_VIEW_BAD_PROXIES_ID);
- if (bad_proxies.hasAttribute('style') &&
- ('cssText' in bad_proxies.style) &&
- bad_proxies.style.cssText == 'display: none;') {
- return null;
- }
- var tbody = doc.getElementById(PROXY_VIEW_BAD_PROXIES_TBODY);
- results = [];
- for (var r = 0, n = tbody.rows.length; r < n; r++) {
- results[r] = {};
- results[r].proxy = tbody.rows[r].cells[0].innerHTML;
- timeSpan = tbody.rows[r].cells[1].getElementsByTagName('span')[0];
- if (timeSpan.hasAttribute('title') && timeSpan.title.indexOf('t=') == 0) {
- results[r].retry = timeSpan.title.substr(2);
- } else {
- results[r].retry = '-1';
- }
- }
- return results;
- }
-
- function getChromeProxyInfo() {
- if (!document.getElementById(PROXY_VIEW_ID)) {
- return null;
- }
- info = {};
- info.proxies = getEffectiveProxies(document);
- info.enabled = (info.proxies.length > 1 &&
- info.proxies[info.proxies.length - 1] == 'direct://' &&
- info.proxies[info.proxies.length - 2] != 'direct://');
- info.badProxies = getBadProxyList(document);
- return info;
- };
- window.__getChromeProxyInfo = getChromeProxyInfo;
-})();
« no previous file with comments | « tools/perf/metrics/OWNERS ('k') | tools/perf/metrics/chrome_proxy.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698