| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:html'; | 5 import 'dart:html'; |
| 5 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 6 import 'package:observatory/src/elements/isolate_ref.dart'; | 7 import 'package:observatory/src/elements/isolate_ref.dart'; |
| 7 import '../mocks.dart'; | 8 import '../mocks.dart'; |
| 8 | 9 |
| 9 main(){ | 10 main() { |
| 10 IsolateRefElement.tag.ensureRegistration(); | 11 IsolateRefElement.tag.ensureRegistration(); |
| 11 | 12 |
| 12 final ref = new IsolateRefMock(id: 'id', name: 'old-name'); | 13 final ref = new IsolateRefMock(id: 'id', name: 'old-name'); |
| 13 final events = new EventRepositoryMock(); | 14 final events = new EventRepositoryMock(); |
| 14 final obj = new IsolateMock(id: 'id', name: 'new-name'); | 15 final obj = new IsolateMock(id: 'id', name: 'new-name'); |
| 15 group('instantiation', () { | 16 group('instantiation', () { |
| 16 test('IsolateRef', () { | 17 test('IsolateRef', () { |
| 17 final e = new IsolateRefElement(ref, events); | 18 final e = new IsolateRefElement(ref, events); |
| 18 expect(e, isNotNull, reason: 'element correctly created'); | 19 expect(e, isNotNull, reason: 'element correctly created'); |
| 19 expect(e.isolate, equals(ref)); | 20 expect(e.isolate, equals(ref)); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 50 await e.onRendered.first; | 51 await e.onRendered.first; |
| 51 expect(e.innerHtml.contains(ref.id), isTrue); | 52 expect(e.innerHtml.contains(ref.id), isTrue); |
| 52 events.add(new IsolateUpdateEventMock(isolate: obj)); | 53 events.add(new IsolateUpdateEventMock(isolate: obj)); |
| 53 await e.onRendered.first; | 54 await e.onRendered.first; |
| 54 expect(e.innerHtml.contains(ref.name), isFalse); | 55 expect(e.innerHtml.contains(ref.name), isFalse); |
| 55 expect(e.innerHtml.contains(obj.name), isTrue); | 56 expect(e.innerHtml.contains(obj.name), isTrue); |
| 56 e.remove(); | 57 e.remove(); |
| 57 }); | 58 }); |
| 58 }); | 59 }); |
| 59 } | 60 } |
| OLD | NEW |