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

Side by Side Diff: packages/usage/test/src/common.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/hit_types_test.dart ('k') | packages/usage/test/usage_impl_io_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.common_test; 5 library usage.common_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:test/test.dart';
10 import 'package:usage/src/usage_impl.dart'; 10 import 'package:usage/src/usage_impl.dart';
11 11
12 AnalyticsImplMock createMock({bool setOptIn: true}) => 12 AnalyticsImplMock createMock({bool setOptIn: true}) =>
13 new AnalyticsImplMock('UA-0', setOptIn: setOptIn); 13 new AnalyticsImplMock('UA-0', setOptIn: setOptIn);
14 14
15 void was(Map m, String type) => expect(m['t'], type); 15 void was(Map m, String type) => expect(m['t'], type);
16 void has(Map m, String key) => expect(m[key], isNotNull); 16 void has(Map m, String key) => expect(m[key], isNotNull);
17 void hasnt(Map m, String key) => expect(m[key], isNull); 17 void hasnt(Map m, String key) => expect(m[key], isNull);
18 18
19 class AnalyticsImplMock extends AnalyticsImpl { 19 class AnalyticsImplMock extends AnalyticsImpl {
(...skipping 15 matching lines...) Expand all
35 MockProperties() : super('mock'); 35 MockProperties() : super('mock');
36 36
37 dynamic operator[](String key) => props[key]; 37 dynamic operator[](String key) => props[key];
38 38
39 void operator[]=(String key, dynamic value) { 39 void operator[]=(String key, dynamic value) {
40 props[key] = value; 40 props[key] = value;
41 } 41 }
42 } 42 }
43 43
44 class MockPostHandler extends PostHandler { 44 class MockPostHandler extends PostHandler {
45 List<Map> sentValues = []; 45 List<Map<String, dynamic>> sentValues = [];
46 46
47 Future sendPost(String url, Map<String, String> parameters) { 47 Future sendPost(String url, Map<String, dynamic> parameters) {
48 sentValues.add(parameters); 48 sentValues.add(parameters);
49 49
50 return new Future.value(); 50 return new Future.value();
51 } 51 }
52 52
53 Map<String, dynamic> get last => sentValues.last; 53 Map<String, dynamic> get last => sentValues.last;
54 } 54 }
OLDNEW
« no previous file with comments | « packages/usage/test/hit_types_test.dart ('k') | packages/usage/test/usage_impl_io_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698