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

Unified Diff: runtime/observatory/test/eval_test.dart

Issue 1071363002: Relocate service library tests and hookup a working status file (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « runtime/observatory/test/echo_test.dart ('k') | runtime/observatory/test/functions_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/test/eval_test.dart
diff --git a/runtime/observatory/test/eval_test.dart b/runtime/observatory/test/eval_test.dart
deleted file mode 100644
index 89afdfa459eaa66100749d4ac694d6caa3deff4d..0000000000000000000000000000000000000000
--- a/runtime/observatory/test/eval_test.dart
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// 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.
-// VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked
-
-import 'package:observatory/service_io.dart';
-import 'package:unittest/unittest.dart';
-import 'test_helper.dart';
-import 'dart:async';
-
-int globalVar = 100;
-
-class MyClass {
- static int staticVar = 1000;
-
- static void printValue(int value) {
- print(value); // line 16
- }
-}
-
-void testFunction() {
- int i = 0;
- while (true) {
- if (++i % 100000000 == 0) {
- MyClass.printValue(10000);
- }
- }
-}
-
-var tests = [
-
-// Go to breakpoint at line 16.
-(Isolate isolate) {
- return isolate.rootLib.load().then((_) {
- // Set up a listener to wait for breakpoint events.
- Completer completer = new Completer();
- isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType == ServiceEvent.kPauseBreakpoint) {
- print('Breakpoint reached');
- completer.complete();
- }
- });
-
- // Add the breakpoint.
- var script = isolate.rootLib.scripts[0];
- var line = 16;
- return isolate.addBreakpoint(script, line).then((ServiceObject bpt) {
- return completer.future; // Wait for breakpoint reached.
- });
- });
-},
-
-// Evaluate against library, class, and instance.
-(Isolate isolate) {
- return isolate.getStack().then((ServiceMap stack) {
- // Make sure we are in the right place.
- expect(stack.type, equals('Stack'));
- expect(stack['frames'].length, greaterThanOrEqualTo(2));
- expect(stack['frames'][0]['function'].name, equals('printValue'));
- expect(stack['frames'][0]['function'].dartOwner.name, equals('MyClass'));
-
- var lib = isolate.rootLib;
- var cls = stack['frames'][0]['function'].dartOwner;
- var instance = stack['frames'][0]['vars'][0]['value'];
-
- List evals = [];
- evals.add(isolate.eval(lib, 'globalVar + 5').then((result) {
- print(result);
- expect(result.valueAsString, equals('105'));
- }));
- evals.add(isolate.eval(lib, 'globalVar + staticVar + 5').then((result) {
- expect(result.type, equals('Error'));
- }));
- evals.add(isolate.eval(cls, 'globalVar + staticVar + 5').then((result) {
- print(result);
- expect(result.valueAsString, equals('1105'));
- }));
- evals.add(isolate.eval(cls, 'this + 5').then((result) {
- expect(result.type, equals('Error'));
- }));
- evals.add(isolate.eval(instance, 'this + 5').then((result) {
- print(result);
- expect(result.valueAsString, equals('10005'));
- }));
- evals.add(isolate.eval(instance, 'this + frog').then((result) {
- expect(result.type, equals('Error'));
- }));
- return Future.wait(evals);
- });
-},
-
-];
-
-main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
« no previous file with comments | « runtime/observatory/test/echo_test.dart ('k') | runtime/observatory/test/functions_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698