| OLD | NEW |
| 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_test; | 5 library usage.usage_test; |
| 6 | 6 |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:test/test.dart'; |
| 8 import 'package:usage/usage.dart'; | 8 import 'package:usage/usage.dart'; |
| 9 | 9 |
| 10 main() => defineTests(); |
| 11 |
| 10 void defineTests() { | 12 void defineTests() { |
| 11 group('AnalyticsMock', () { | 13 group('AnalyticsMock', () { |
| 12 test('simple', () { | 14 test('simple', () { |
| 13 AnalyticsMock mock = new AnalyticsMock(); | 15 AnalyticsMock mock = new AnalyticsMock(); |
| 14 mock.sendScreenView('main'); | 16 mock.sendScreenView('main'); |
| 15 mock.sendEvent('files', 'save'); | 17 mock.sendEvent('files', 'save'); |
| 16 mock.sendSocial('g+', 'plus', 'userid'); | 18 mock.sendSocial('g+', 'plus', 'userid'); |
| 17 mock.sendTiming('compile', 123); | 19 mock.sendTiming('compile', 123); |
| 18 mock.startTimer('compile').finish(); | 20 mock.startTimer('compile').finish(); |
| 19 mock.sendException('FooException'); | 21 mock.sendException('FooException'); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 }); | 54 }); |
| 53 | 55 |
| 54 test('shorten 3', () { | 56 test('shorten 3', () { |
| 55 expect(sanitizeStacktrace( | 57 expect(sanitizeStacktrace( |
| 56 'foo (package:foo/foo.dart:3:13)\n' | 58 'foo (package:foo/foo.dart:3:13)\n' |
| 57 'bar (dart:async/schedule_microtask.dart:41)'), | 59 'bar (dart:async/schedule_microtask.dart:41)'), |
| 58 'foo (foo/foo.dart:3:13) bar (async/schedule_microtask.dart:41)'); | 60 'foo (foo/foo.dart:3:13) bar (async/schedule_microtask.dart:41)'); |
| 59 }); | 61 }); |
| 60 }); | 62 }); |
| 61 } | 63 } |
| OLD | NEW |