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

Side by Side Diff: net/data/proxy_resolver_v8_unittest/pac_library_unittest.js

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « net/cert/ct_known_logs_static.h ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This should output "PROXY success:80" if all the tests pass. 5 // This should output "PROXY success:80" if all the tests pass.
6 // Otherwise it will output "PROXY failure:<num-failures>". 6 // Otherwise it will output "PROXY failure:<num-failures>".
7 // 7 //
8 // This aims to unit-test the PAC library functions, which are 8 // This aims to unit-test the PAC library functions, which are
9 // exposed in the PAC's execution environment. (Namely, dnsDomainLevels, 9 // exposed in the PAC's execution environment. (Namely, dnsDomainLevels,
10 // timeRange, etc.) 10 // timeRange, etc.)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 Tests.testIsPlainHostName = function(t) { 65 Tests.testIsPlainHostName = function(t) {
66 t.expectTrue(isPlainHostName("google")); 66 t.expectTrue(isPlainHostName("google"));
67 t.expectFalse(isPlainHostName("google.com")); 67 t.expectFalse(isPlainHostName("google.com"));
68 t.expectFalse(isPlainHostName("192.168.1.1")); 68 t.expectFalse(isPlainHostName("192.168.1.1"));
69 t.expectFalse(isPlainHostName(".")); 69 t.expectFalse(isPlainHostName("."));
70 t.expectFalse(isPlainHostName(".:")); 70 t.expectFalse(isPlainHostName(".:"));
71 71
72 // Valid IPv6 address 72 // Valid IPv6 address
73 t.expectFalse(isPlainHostName("::1")); 73 t.expectFalse(isPlainHostName("::1"));
74 74
75 // Valid IPv6 address containing periods.
76 t.expectFalse(isPlainHostName("::192.186.1.1"));
77
75 // Not a valid IPv6 address 78 // Not a valid IPv6 address
76 t.expectTrue(isPlainHostName("foopy::1")); 79 t.expectTrue(isPlainHostName("foopy::1"));
77 t.expectTrue(isPlainHostName("foo:112")); 80 t.expectTrue(isPlainHostName("foo:112"));
78 t.expectTrue(isPlainHostName(":")); 81 t.expectTrue(isPlainHostName(":"));
79 t.expectTrue(isPlainHostName("[:]")); 82 t.expectTrue(isPlainHostName("[:]"));
80 83
81 // Not considered a valid IPv6 address because of surrounding brackets. 84 // Not considered a valid IPv6 address because of surrounding brackets.
82 t.expectTrue(isPlainHostName("[::1]")); 85 t.expectTrue(isPlainHostName("[::1]"));
83 86
84 // Calling with more than 1 argument is allowed. 87 // Calling with more than 1 argument is allowed.
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 "toGMTString", "toUTCString", "getYear", "setYear" 414 "toGMTString", "toUTCString", "getYear", "setYear"
412 ]; 415 ];
413 416
414 MockDate.setCurrent = function(currentDateString) { 417 MockDate.setCurrent = function(currentDateString) {
415 MockDate.currentDateString_ = currentDateString; 418 MockDate.currentDateString_ = currentDateString;
416 } 419 }
417 420
418 // Bind the methods to proxy requests to the wrapped Date(). 421 // Bind the methods to proxy requests to the wrapped Date().
419 MockDate.init(); 422 MockDate.init();
420 423
OLDNEW
« no previous file with comments | « net/cert/ct_known_logs_static.h ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698