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

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

Issue 2212253002: Converted Observatory class-tree element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Removed tmp code Created 4 years, 4 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
« no previous file with comments | « runtime/observatory/tests/observatory_ui/mocks/repositories/script.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/observatory_ui/source_link/element_test.dart
diff --git a/runtime/observatory/tests/observatory_ui/source_link/element_test.dart b/runtime/observatory/tests/observatory_ui/source_link/element_test.dart
index 5d36fd140edf1eee68f625692d5764c4099c375a..3dcb5ddaa052b44c20cd11c1674ca8aee1cd53fb 100644
--- a/runtime/observatory/tests/observatory_ui/source_link/element_test.dart
+++ b/runtime/observatory/tests/observatory_ui/source_link/element_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';
import 'package:unittest/unittest.dart';
-import 'package:observatory/models.dart' as M;
import 'package:observatory/src/elements/source_link.dart';
import '../mocks.dart';
@@ -11,25 +10,30 @@ main() {
SourceLinkElement.tag.ensureRegistration();
const isolate = const IsolateRefMock(id: 'isolate-id');
+ const script_id = 'script-id';
const file = 'filename.dart';
- final script = new ScriptMock(id: 'script-id', uri: 'package/$file',
+ final script = new ScriptMock(id: script_id, uri: 'package/$file',
tokenToLine: (int token) => 1, tokenToCol: (int token) => 2);
final location = new SourceLocationMock(script: script, tokenPos: 0,
endTokenPos: 1);
- M.ScriptRepository repository;
- setUp(() {
- repository = new ScriptRepositoryMock({ 'script-id': script });
- });
test('instantiation', () {
- final e = new SourceLinkElement(isolate, location, repository);
+ final e = new SourceLinkElement(isolate, location,
+ new ScriptRepositoryMock());
expect(e, isNotNull, reason: 'element correctly created');
expect(e.isolate, equals(isolate));
expect(e.location, equals(location));
});
test('elements created after attachment', () async {
- final e = new SourceLinkElement(isolate, location, repository);
+ bool rendered = false;
+ final e = new SourceLinkElement(isolate, location,
+ new ScriptRepositoryMock(getter: expectAsync((String id) async {
+ expect(rendered, isFalse);
+ expect(id, equals(script_id));
+ return script;
+ }, count: 1)));
document.body.append(e);
await e.onRendered.first;
+ rendered = true;
expect(e.children.length, isNonZero, reason: 'has elements');
expect(e.innerHtml.contains(isolate.id), isTrue,
reason: 'no message in the component');
« no previous file with comments | « runtime/observatory/tests/observatory_ui/mocks/repositories/script.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698