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

Side by Side Diff: runtime/observatory/tests/observatory_ui/nav/class-menu/element_test.dart

Issue 2173373002: Revert "Use Timer and not AnimationFrame during Observatory UI tests" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Revert "Use Timer and not AnimationFrame during Observatory UI tests" 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
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 import 'dart:html'; 4 import 'dart:html';
5 import 'package:unittest/unittest.dart'; 5 import 'package:unittest/unittest.dart';
6 import 'package:observatory/mocks.dart'; 6 import 'package:observatory/mocks.dart';
7 import 'package:observatory/src/elements/helpers/rendering_queue.dart';
8 import 'package:observatory/src/elements/nav/class_menu.dart'; 7 import 'package:observatory/src/elements/nav/class_menu.dart';
9 8
10 main(){ 9 main(){
11 NavClassMenuElement.tag.ensureRegistration(); 10 NavClassMenuElement.tag.ensureRegistration();
12 11
13 final TimedRenderingBarrier barrier = new TimedRenderingBarrier();
14 final RenderingQueue queue = new RenderingQueue.fromBarrier(barrier);
15
16 final IsolateRefMock i_ref = const IsolateRefMock(id: 'i-id', name: 'i-name'); 12 final IsolateRefMock i_ref = const IsolateRefMock(id: 'i-id', name: 'i-name');
17 final ClassRefMock c_ref = const ClassRefMock(id: 'c-id', name: 'c-name'); 13 final ClassRefMock c_ref = const ClassRefMock(id: 'c-id', name: 'c-name');
18 test('instantiation', () { 14 test('instantiation', () {
19 final NavClassMenuElement e = new NavClassMenuElement(i_ref, c_ref); 15 final NavClassMenuElement e = new NavClassMenuElement(i_ref, c_ref);
20 expect(e, isNotNull, reason: 'element correctly created'); 16 expect(e, isNotNull, reason: 'element correctly created');
21 expect(e.isolate, equals(i_ref)); 17 expect(e.isolate, equals(i_ref));
22 expect(e.cls, equals(c_ref)); 18 expect(e.cls, equals(c_ref));
23 }); 19 });
24 test('elements created after attachment', () async { 20 test('elements created after attachment', () async {
25 final NavClassMenuElement e = new NavClassMenuElement(i_ref, c_ref, 21 final NavClassMenuElement e = new NavClassMenuElement(i_ref, c_ref);
26 queue: queue);
27 document.body.append(e); 22 document.body.append(e);
28 await e.onRendered.first; 23 await e.onRendered.first;
29 expect(e.shadowRoot.children.length, isNonZero, reason: 'has elements'); 24 expect(e.shadowRoot.children.length, isNonZero, reason: 'has elements');
30 e.remove(); 25 e.remove();
31 await e.onRendered.first; 26 await e.onRendered.first;
32 expect(e.shadowRoot.children.length, isZero, reason: 'is empty'); 27 expect(e.shadowRoot.children.length, isZero, reason: 'is empty');
33 }); 28 });
34 } 29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698