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

Unified Diff: packages/usage/test/usage_impl_io_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/usage/test/usage_impl_io_test.dart
diff --git a/packages/usage/test/usage_impl_io_test.dart b/packages/usage/test/usage_impl_io_test.dart
index e41f241a4486d39f7fcf253e61040d3e9cbc4866..888907785f093a53c88a28fc72da91500a1cf473 100644
--- a/packages/usage/test/usage_impl_io_test.dart
+++ b/packages/usage/test/usage_impl_io_test.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+@TestOn('!browser')
library usage.usage_impl_io_test;
import 'dart:async';
@@ -14,13 +15,12 @@ main() => defineTests();
void defineTests() {
group('IOPostHandler', () {
- test('sendPost', () {
+ test('sendPost', () async {
var httpClient = new MockHttpClient();
IOPostHandler postHandler = new IOPostHandler(mockClient: httpClient);
Map<String, dynamic> args = {'utv': 'varName', 'utt': 123};
- return postHandler.sendPost('http://www.google.com', args).then((_) {
- expect(httpClient.sendCount, 1);
- });
+ await postHandler.sendPost('http://www.google.com', args);
+ expect(httpClient.sendCount, 1);
});
});
@@ -39,38 +39,65 @@ void defineTests() {
expect(props['foo'], null);
});
});
+
+ group('usage_impl_io', () {
+ test('getDartVersion', () {
+ expect(getDartVersion(), isNotNull);
+ });
+
+ test('getPlatformLocale', () {
+ expect(getPlatformLocale(), isNotNull);
+ });
+ });
}
class MockHttpClient implements HttpClient {
+ @override
String userAgent;
int sendCount = 0;
int writeCount = 0;
bool closed = false;
+
+ @override
Future<HttpClientRequest> postUrl(Uri url) {
return new Future.value(new MockHttpClientRequest(this));
}
- noSuchMethod(Invocation invocation) { }
+
+ @override
+ noSuchMethod(Invocation invocation) {}
}
class MockHttpClientRequest implements HttpClientRequest {
final MockHttpClient client;
+
MockHttpClientRequest(this.client);
+
+ @override
void write(Object obj) {
client.writeCount++;
}
+
+ @override
Future<HttpClientResponse> close() {
client.closed = true;
return new Future.value(new MockHttpClientResponse(client));
}
- noSuchMethod(Invocation invocation) { }
+
+ @override
+ noSuchMethod(Invocation invocation) {}
}
class MockHttpClientResponse implements HttpClientResponse {
final MockHttpClient client;
+
MockHttpClientResponse(this.client);
- Future drain([var futureValue]) {
+
+ @override
+ Future/*<E>*/ drain/*<E>*/([/*=E*/ futureValue]) {
client.sendCount++;
return new Future.value();
}
- noSuchMethod(Invocation invocation) { }
+
+ @override
+ noSuchMethod(Invocation invocation) {}
}
« 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