OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import "dart:io"; | 6 import "dart:io"; |
7 import "dart:uri"; | |
8 | 7 |
9 expect(expected, String uri, environment) { | 8 expect(expected, String uri, environment) { |
10 Expect.equals(expected, | 9 Expect.equals(expected, |
11 HttpClient.findProxyFromEnvironment(Uri.parse(uri), | 10 HttpClient.findProxyFromEnvironment(Uri.parse(uri), |
12 environment: environment)); | 11 environment: environment)); |
13 } | 12 } |
14 | 13 |
15 expectDirect(String uri, environment) { | 14 expectDirect(String uri, environment) { |
16 Expect.equals("DIRECT", | 15 Expect.equals("DIRECT", |
17 HttpClient.findProxyFromEnvironment(Uri.parse(uri), | 16 HttpClient.findProxyFromEnvironment(Uri.parse(uri), |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 "no_proxy": ".com"}); | 81 "no_proxy": ".com"}); |
83 expectDirect("http://www.google.com", | 82 expectDirect("http://www.google.com", |
84 {"http_proxy": "www.proxy.com:8080", | 83 {"http_proxy": "www.proxy.com:8080", |
85 "no_proxy": ",, , www.google.edu,,.com "}); | 84 "no_proxy": ",, , www.google.edu,,.com "}); |
86 expectDirect("http://www.google.edu", | 85 expectDirect("http://www.google.edu", |
87 {"http_proxy": "www.proxy.com:8080", | 86 {"http_proxy": "www.proxy.com:8080", |
88 "no_proxy": ",, , www.google.edu,,.com "}); | 87 "no_proxy": ",, , www.google.edu,,.com "}); |
89 expectDirect("http://www.google.com", | 88 expectDirect("http://www.google.com", |
90 {"https_proxy": "www.proxy.com:8080"}); | 89 {"https_proxy": "www.proxy.com:8080"}); |
91 } | 90 } |
OLD | NEW |