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

Unified Diff: runtime/observatory/tests/observatory_ui/script_ref/element_test.dart

Issue 2180553002: Converted Observatory source-link & script-ref elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Converted Observatory source-link & script-ref elements 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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/tests/observatory_ui/script_ref/element_test.dart
diff --git a/runtime/observatory/tests/observatory_ui/script_ref/element_test.dart b/runtime/observatory/tests/observatory_ui/script_ref/element_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..eda7d49a47e84df1ed7da36f3a1c789ec8c6a37a
--- /dev/null
+++ b/runtime/observatory/tests/observatory_ui/script_ref/element_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2016, 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.
+import 'dart:html';
+import 'package:unittest/unittest.dart';
+import 'package:observatory/mocks.dart';
+import 'package:observatory/models.dart' as M;
+import 'package:observatory/src/elements/script_ref.dart';
+
+main() {
+ ScriptRefElement.tag.ensureRegistration();
+
+ final M.IsolateRef isolate = const IsolateRefMock(id: 'isolate-id');
+ final M.ScriptRef ref = const ScriptRefMock(id: 'script-id',
+ uri: 'package/filename.dart');
+ group('instantiation', () {
+ test('no position', () {
+ final ScriptRefElement e = new ScriptRefElement(isolate, ref);
+ expect(e, isNotNull, reason: 'element correctly created');
+ expect(e.isolate, equals(isolate));
+ expect(e.script, equals(ref));
+ });
+ });
+ test('elements created after attachment', () async {
+ final ScriptRefElement e = new ScriptRefElement(isolate, ref);
+ document.body.append(e);
+ await e.onRendered.first;
+ expect(e.children.length, isNonZero, reason: 'has elements');
+ expect(e.innerHtml.contains(isolate.id), isTrue,
+ reason: 'no message in the component');
+ expect(e.innerHtml.contains('filename.dart'), isTrue,
+ reason: 'no message in the component');
+ e.remove();
+ await e.onRendered.first;
+ expect(e.children.length, isZero,
+ reason: 'is empty');
+ });
+}
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('k') | runtime/observatory/tests/observatory_ui/script_ref/element_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698