| 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 2d4cfba336b8eb22a0688c6de71ae36a7bb1a5ec..5d36fd140edf1eee68f625692d5764c4099c375a 100644
|
| --- a/runtime/observatory/tests/observatory_ui/source_link/element_test.dart
|
| +++ b/runtime/observatory/tests/observatory_ui/source_link/element_test.dart
|
| @@ -3,40 +3,37 @@
|
| // 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/source_link.dart';
|
| +import '../mocks.dart';
|
|
|
| main() {
|
| SourceLinkElement.tag.ensureRegistration();
|
|
|
| - final M.IsolateRef isolate = const IsolateRefMock(id: 'isolate-id');
|
| - final M.Script script = new ScriptMock(id: 'script-id',
|
| - uri: 'package/filename.dart',
|
| - tokenToLine: (int token) => 1,
|
| - tokenToCol: (int token) => 2);
|
| - final M.SourceLocation location = new SourceLocationMock(script: script,
|
| - tokenPos: 0, endTokenPos: 1);
|
| + const isolate = const IsolateRefMock(id: 'isolate-id');
|
| + const file = 'filename.dart';
|
| + 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 SourceLinkElement e = new SourceLinkElement(isolate, location,
|
| - repository);
|
| + final e = new SourceLinkElement(isolate, location, repository);
|
| expect(e, isNotNull, reason: 'element correctly created');
|
| expect(e.isolate, equals(isolate));
|
| expect(e.location, equals(location));
|
| });
|
| test('elements created after attachment', () async {
|
| - final SourceLinkElement e = new SourceLinkElement(isolate, location,
|
| - repository);
|
| + final e = new SourceLinkElement(isolate, location, repository);
|
| 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,
|
| + expect(e.innerHtml.contains(file), isTrue,
|
| reason: 'no message in the component');
|
| e.remove();
|
| await e.onRendered.first;
|
|
|