| 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 // VMOptions=--error_on_bad_type --error_on_bad_override | 4 // VMOptions=--error_on_bad_type --error_on_bad_override |
| 5 | 5 |
| 6 library vm_references_test; | 6 library vm_references_test; |
| 7 | 7 |
| 8 import 'dart:mirrors'; | 8 import 'dart:mirrors'; |
| 9 import 'package:observatory/service_io.dart'; | 9 import 'package:observatory/service_io.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 lib.variables.singleWhere((v) => v.name == 'weak_property'); | 48 lib.variables.singleWhere((v) => v.name == 'weak_property'); |
| 49 await propField.load(); | 49 await propField.load(); |
| 50 Instance prop = propField.staticValue; | 50 Instance prop = propField.staticValue; |
| 51 | 51 |
| 52 expect(key.isWeakProperty, isFalse); | 52 expect(key.isWeakProperty, isFalse); |
| 53 expect(value.isWeakProperty, isFalse); | 53 expect(value.isWeakProperty, isFalse); |
| 54 expect(prop.isWeakProperty, isTrue); | 54 expect(prop.isWeakProperty, isTrue); |
| 55 expect(prop.key, isNull); | 55 expect(prop.key, isNull); |
| 56 expect(prop.value, isNull); | 56 expect(prop.value, isNull); |
| 57 Instance loadedProp = await prop.load(); | 57 Instance loadedProp = await prop.load(); |
| 58 // Object ids are not cannonicalized, so we rely on the key and value | 58 // Object ids are not canonicalized, so we rely on the key and value |
| 59 // being the sole instances of their classes to test we got the objects | 59 // being the sole instances of their classes to test we got the objects |
| 60 // we expect. | 60 // we expect. |
| 61 expect(loadedProp.key, isNotNull); | 61 expect(loadedProp.key, isNotNull); |
| 62 expect(loadedProp.key.clazz, equals(key.clazz)); | 62 expect(loadedProp.key.clazz, equals(key.clazz)); |
| 63 expect(loadedProp.value, isNotNull); | 63 expect(loadedProp.value, isNotNull); |
| 64 expect(loadedProp.value.clazz, equals(value.clazz)); | 64 expect(loadedProp.value.clazz, equals(value.clazz)); |
| 65 }, | 65 }, |
| 66 ]; | 66 ]; |
| 67 | 67 |
| 68 main(args) => runIsolateTests(args, tests, testeeBefore: script); | 68 main(args) => runIsolateTests(args, tests, testeeBefore: script); |
| OLD | NEW |