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

Side by Side Diff: runtime/observatory/tests/observatory_ui/isolate_ref_test.dart

Issue 2119733003: Wrapping leaf nodes in non polymer elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Converted error-ref tag Created 4 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) 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
3 // BSD-style license that can be found in the LICENSE file.
4 import 'dart:html';
5 import 'dart:async';
6 import 'package:unittest/unittest.dart';
7 import 'package:observatory/repositories.dart';
8 import 'package:observatory/src/elements/isolate_ref.dart';
9
10 import 'helpers/webcomponents.dart';
11
12 main() async{
rmacnak 2016/07/11 17:54:01 async {
cbernaschina 2016/07/11 18:14:12 This was replaced in the last version. Going to up
13 await loadWebComponents();
14 IsolateRefElement.tag.ensureRegistration();
15
16 StreamController<IsolateUpdateEvent> updatesController;
17 final IsolateRefMock ref = new IsolateRefMock(id: 'id', name: 'old-name');
18 final IsolateMock obj = new IsolateMock(id: 'id', name: 'new-name');
19 setUp(() {
20 updatesController = new StreamController<IsolateUpdateEvent>();
21 });
22 group('instantiation', () {
23 test('IsolateRef', () {
24 final IsolateRefElement e = new IsolateRefElement(ref,
25 updatesController.stream);
26 expect(e, isNotNull, reason: 'element correctly created');
27 expect(e.isolate, equals(ref));
28 });
29 test('Isolate', () {
30 final IsolateRefElement e = new IsolateRefElement(obj,
31 updatesController.stream);
32 expect(e, isNotNull, reason: 'element correctly created');
33 expect(e.isolate, equals(obj));
34 });
35 });
36 group('elements', () {
37 test('created after attachment', () {
38 final IsolateRefElement e = new IsolateRefElement(ref,
39 updatesController.stream);
40 expect(e.children.length, isZero,
41 reason: 'is empty');
42 document.body.append(e);
43 expect(e.children.length, isNonZero,
44 reason: 'has elements');
45 e.remove();
46 });
47 });
48 group('updates', () {
49 test('are correctly listen', () {
50 final IsolateRefElement e = new IsolateRefElement(ref,
51 updatesController.stream);
52 expect(updatesController.hasListener, isFalse);
53 document.body.append(e);
54 expect(updatesController.hasListener, isTrue);
55 e.remove();
56 expect(updatesController.hasListener, isFalse);
57 });
58 test('have effects', () async {
59 final IsolateRefElement e = new IsolateRefElement(ref,
60 updatesController.stream);
61 document.body.append(e);
62 expect(e.innerHtml.contains(ref.id), isTrue);
63 Future check() async {
64 expect(e.innerHtml.contains(ref.name), isFalse);
65 expect(e.innerHtml.contains(obj.name), isTrue);
66 };
67 updatesController.add(new IsolateUpdateEvent(obj));
68 await check();
69 e.remove();
70 });
71 });
72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698