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

Side by Side Diff: runtime/observatory/tests/service/logging_test.dart

Issue 1241683005: Support piping log data over the service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015, 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 // VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
5
6 import 'dart:developer' as developer;
7 import 'package:observatory/service_io.dart';
8 import 'package:unittest/unittest.dart';
9 import 'package:logging/logging.dart';
10
11 import 'test_helper.dart';
12
13 void init() {
14 Logger.root.level = Level.ALL;
15 Logger.root.onRecord.listen(developer.logOnRecord);
16 }
17
18 void run() {
19 developer.debugger();
20 Logger.root.fine('Hey Buddy!');
21 developer.debugger();
22 Logger.root.info('YES');
23 }
24
25 var tests = [
26 hasStoppedAtBreakpoint,
27 resumeIsolateAndAwaitEvent(Isolate.kLoggingStream, (ServiceEvent event) {
28 expect(event.kind, equals(ServiceEvent.kLogging));
29 expect(event.logRecord['sequenceNumber'], equals(0));
30 expect(event.logRecord['message'].valueAsString, equals('Hey Buddy!'));
31 expect(event.logRecord['level'], equals(Level.FINE));
32 expect(event.logRecord['time'], new isInstanceOf<DateTime>());
33 }),
34 resumeIsolateAndAwaitEvent(Isolate.kLoggingStream, (ServiceEvent event) {
35 expect(event.kind, equals(ServiceEvent.kLogging));
36 expect(event.logRecord['sequenceNumber'], equals(1));
37 expect(event.logRecord['level'], equals(Level.INFO));
38 expect(event.logRecord['message'].valueAsString, equals('YES'));
39 expect(event.logRecord['time'], new isInstanceOf<DateTime>());
40 }),
41 ];
42
43 main(args) => runIsolateTests(args,
44 tests,
45 testeeBefore: init,
46 testeeConcurrent: run);
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/observatory/tests/service/test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698