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

Side by Side Diff: lib/testing.dart

Issue 1580273002: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/http@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « lib/src/utils.dart ('k') | test/html/client_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /// This library contains testing classes for the HTTP library. 5 /// This library contains testing classes for the HTTP library.
6 /// 6 ///
7 /// The [MockClient] class is a drop-in replacement for `http.Client` that 7 /// The [MockClient] class is a drop-in replacement for `http.Client` that
8 /// allows test code to set up a local request handler in order to fake a server 8 /// allows test code to set up a local request handler in order to fake a server
9 /// that responds to HTTP requests: 9 /// that responds to HTTP requests:
10 /// 10 ///
11 /// import 'dart:convert'; 11 /// import 'dart:convert';
12 /// import 'package:http/testing.dart'; 12 /// import 'package:http/testing.dart';
13 /// 13 ///
14 /// var client = new MockClient((request) { 14 /// var client = new MockClient((request) {
15 /// if (request.url.path != "/data.json") { 15 /// if (request.url.path != "/data.json") {
16 /// return new Response("", 404); 16 /// return new Response("", 404);
17 /// } 17 /// }
18 /// return new Response(JSON.encode({ 18 /// return new Response(JSON.encode({
19 /// 'numbers': [1, 4, 15, 19, 214] 19 /// 'numbers': [1, 4, 15, 19, 214]
20 /// }, 200, headers: { 20 /// }, 200, headers: {
21 /// 'content-type': 'application/json' 21 /// 'content-type': 'application/json'
22 /// }); 22 /// });
23 /// }; 23 /// };
24 library http.testing;
25
26 export 'src/mock_client.dart'; 24 export 'src/mock_client.dart';
OLDNEW
« no previous file with comments | « lib/src/utils.dart ('k') | test/html/client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698