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

Side by Side Diff: packages/usage/test/usage_impl_io_test.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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 | « packages/usage/test/src/common.dart ('k') | packages/usage/test/usage_impl_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library usage.usage_impl_io_test; 5 library usage.usage_impl_io_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:test/test.dart';
11 import 'package:usage/src/usage_impl_io.dart'; 11 import 'package:usage/src/usage_impl_io.dart';
12 12
13 main() => defineTests();
14
13 void defineTests() { 15 void defineTests() {
14 group('IOPostHandler', () { 16 group('IOPostHandler', () {
15 test('sendPost', () { 17 test('sendPost', () {
16 var httpClient = new MockHttpClient(); 18 var httpClient = new MockHttpClient();
17 IOPostHandler postHandler = new IOPostHandler(mockClient: httpClient); 19 IOPostHandler postHandler = new IOPostHandler(mockClient: httpClient);
18 Map args = {'utv': 'varName', 'utt': 123}; 20 Map<String, dynamic> args = {'utv': 'varName', 'utt': 123};
19 return postHandler.sendPost('http://www.google.com', args).then((_) { 21 return postHandler.sendPost('http://www.google.com', args).then((_) {
20 expect(httpClient.sendCount, 1); 22 expect(httpClient.sendCount, 1);
21 }); 23 });
22 }); 24 });
23 }); 25 });
24 26
25 group('IOPersistentProperties', () { 27 group('IOPersistentProperties', () {
26 test('add', () { 28 test('add', () {
27 IOPersistentProperties props = new IOPersistentProperties('foo_props'); 29 IOPersistentProperties props = new IOPersistentProperties('foo_props');
28 props['foo'] = 'bar'; 30 props['foo'] = 'bar';
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 67
66 class MockHttpClientResponse implements HttpClientResponse { 68 class MockHttpClientResponse implements HttpClientResponse {
67 final MockHttpClient client; 69 final MockHttpClient client;
68 MockHttpClientResponse(this.client); 70 MockHttpClientResponse(this.client);
69 Future drain([var futureValue]) { 71 Future drain([var futureValue]) {
70 client.sendCount++; 72 client.sendCount++;
71 return new Future.value(); 73 return new Future.value();
72 } 74 }
73 noSuchMethod(Invocation invocation) { } 75 noSuchMethod(Invocation invocation) { }
74 } 76 }
OLDNEW
« no previous file with comments | « packages/usage/test/src/common.dart ('k') | packages/usage/test/usage_impl_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698