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

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

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « packages/usage/test/usage_impl_test.dart ('k') | packages/usage/test/uuid_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library usage.usage_test;
6
7 import 'package:unittest/unittest.dart';
8 import 'package:usage/usage.dart';
9
10 void defineTests() {
11 group('AnalyticsMock', () {
12 test('simple', () {
13 AnalyticsMock mock = new AnalyticsMock();
14 mock.sendScreenView('main');
15 mock.sendEvent('files', 'save');
16 mock.sendSocial('g+', 'plus', 'userid');
17 mock.sendTiming('compile', 123);
18 mock.startTimer('compile').finish();
19 mock.sendException('FooException');
20 mock.setSessionValue('val', 'ue');
21 return mock.waitForLastPing();
22 });
23 });
24
25 group('sanitizeStacktrace', () {
26 test('replace file', () {
27 expect(sanitizeStacktrace(
28 '(file:///Users/foo/tmp/error.dart:3:13)',
29 shorten: false),
30 '(error.dart:3:13)');
31 });
32
33 test('replace files', () {
34 expect(sanitizeStacktrace(
35 'foo (file:///Users/foo/tmp/error.dart:3:13)\n'
36 'bar (file:///Users/foo/tmp/error.dart:3:13)',
37 shorten: false),
38 'foo (error.dart:3:13)\nbar (error.dart:3:13)');
39 });
40
41 test('shorten 1', () {
42 expect(sanitizeStacktrace(
43 '(file:///Users/foo/tmp/error.dart:3:13)'),
44 '(error.dart:3:13)');
45 });
46
47 test('shorten 2', () {
48 expect(sanitizeStacktrace(
49 'foo (file:///Users/foo/tmp/error.dart:3:13)\n'
50 'bar (file:///Users/foo/tmp/error.dart:3:13)'),
51 'foo (error.dart:3:13) bar (error.dart:3:13)');
52 });
53
54 test('shorten 3', () {
55 expect(sanitizeStacktrace(
56 'foo (package:foo/foo.dart:3:13)\n'
57 'bar (dart:async/schedule_microtask.dart:41)'),
58 'foo (foo/foo.dart:3:13) bar (async/schedule_microtask.dart:41)');
59 });
60 });
61 }
OLDNEW
« no previous file with comments | « packages/usage/test/usage_impl_test.dart ('k') | packages/usage/test/uuid_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698