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

Side by Side Diff: tests/standalone/io/http_proxy_test.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/http_auth_test.dart ('k') | tests/standalone/io/io_sink_test.dart » ('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) 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:async"; 6 import "dart:async";
7 import 'dart:crypto'; 7 import 'dart:crypto';
8 import "dart:io"; 8 import "dart:io";
9 import "dart:uri"; 9 import "dart:uri";
10 import 'dart:utf'; 10 import 'dart:utf';
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 client.findProxy = (Uri uri) { 487 client.findProxy = (Uri uri) {
488 return "PROXY localhost:${proxyServer.port}"; 488 return "PROXY localhost:${proxyServer.port}";
489 }; 489 };
490 490
491 client.authenticateProxy = (host, port, scheme, realm) { 491 client.authenticateProxy = (host, port, scheme, realm) {
492 client.addProxyCredentials( 492 client.addProxyCredentials(
493 "localhost", 493 "localhost",
494 proxyServer.port, 494 proxyServer.port,
495 "realm", 495 "realm",
496 new HttpClientBasicCredentials("test", "test")); 496 new HttpClientBasicCredentials("test", "test"));
497 return new Future.immediate(true); 497 return new Future.value(true);
498 }; 498 };
499 499
500 for (int i = 0; i < loopCount; i++) { 500 for (int i = 0; i < loopCount; i++) {
501 test(bool secure) { 501 test(bool secure) {
502 String url = secure 502 String url = secure
503 ? "https://localhost:${secureServer.port}/A" 503 ? "https://localhost:${secureServer.port}/A"
504 : "http://127.0.0.1:${server.port}/A"; 504 : "http://127.0.0.1:${server.port}/A";
505 505
506 client.postUrl(Uri.parse(url)) 506 client.postUrl(Uri.parse(url))
507 .then((HttpClientRequest clientRequest) { 507 .then((HttpClientRequest clientRequest) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 testDirectProxy(); 627 testDirectProxy();
628 testProxy(); 628 testProxy();
629 testProxyChain(); 629 testProxyChain();
630 testProxyFromEnviroment(); 630 testProxyFromEnviroment();
631 testProxyAuthenticate(); 631 testProxyAuthenticate();
632 // This test is not normally run. It can be used for locally testing 632 // This test is not normally run. It can be used for locally testing
633 // with a real proxy server (e.g. Apache). 633 // with a real proxy server (e.g. Apache).
634 //testRealProxy(); 634 //testRealProxy();
635 //testRealProxyAuth(); 635 //testRealProxyAuth();
636 } 636 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_auth_test.dart ('k') | tests/standalone/io/io_sink_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698