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

Unified Diff: net/data/proxy_resolver_v8_unittest/passthrough.js

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
Index: net/data/proxy_resolver_v8_unittest/passthrough.js
diff --git a/net/data/proxy_resolver_v8_unittest/passthrough.js b/net/data/proxy_resolver_v8_unittest/passthrough.js
deleted file mode 100644
index 832ac6624b439b2fe7c5358d4d4d99b16d0209f9..0000000000000000000000000000000000000000
--- a/net/data/proxy_resolver_v8_unittest/passthrough.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// Return a single-proxy result, which encodes ALL the arguments that were
-// passed to FindProxyForURL().
-
-function FindProxyForURL(url, host) {
- if (arguments.length != 2) {
- throw "Wrong number of arguments passed to FindProxyForURL!";
- return "FAIL";
- }
-
- return "PROXY " + makePseudoHost(url + "." + host);
-}
-
-// Form a string that kind-of resembles a host. We will replace any
-// non-alphanumeric character with a dot, then fix up the oddly placed dots.
-function makePseudoHost(str) {
- var result = "";
-
- for (var i = 0; i < str.length; ++i) {
- var c = str.charAt(i);
- if (!isValidPseudoHostChar(c)) {
- c = '.'; // Replace unsupported characters with a dot.
- }
-
- // Take care not to place multiple adjacent dots,
- // a dot at the beginning, or a dot at the end.
- if (c == '.' &&
- (result.length == 0 ||
- i == str.length - 1 ||
- result.charAt(result.length - 1) == '.')) {
- continue;
- }
- result += c;
- }
- return result;
-}
-
-function isValidPseudoHostChar(c) {
- if (c >= '0' && c <= '9')
- return true;
- if (c >= 'a' && c <= 'z')
- return true;
- if (c >= 'A' && c <= 'Z')
- return true;
- return false;
-}
« no previous file with comments | « net/data/proxy_resolver_v8_unittest/pac_library_unittest.js ('k') | net/data/proxy_resolver_v8_unittest/resolve_host.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698