Fix VM connect element test

BUG=

Review URL: https://codereview.chromium.org/2348313002 .
This commit is contained in:
John McCutchan 2016-09-19 07:33:44 -07:00
parent e24939f8d6
commit 699e328105
2 changed files with 3 additions and 3 deletions

View file

@ -98,7 +98,8 @@ class VMConnectElement extends HtmlElement implements Renderable {
..children = _targets.list().map((target) {
final ObservatoryApplication app =
ObservatoryApplication.app;
final bool current = app.isConnectedVMTarget(target);
final bool current = (app != null) ?
app.isConnectedVMTarget(target) : false;
return new LIElement()
..children = [
new VMConnectTargetElement(target,

View file

@ -45,7 +45,6 @@ main() {
document.body.append(e);
await e.onRendered.first;
expect(targets.listInvoked, isTrue, reason: 'should invoke list()');
expect(targets.currentInvoked, isTrue, reason: 'should invoke current');
expect(e.children.length, isNonZero, reason: 'has elements');
expect(e.querySelectorAll(nTag).length, equals(1));
expect(e.querySelectorAll(tTag).length, equals(2));
@ -72,7 +71,7 @@ main() {
});
group('invokes', () {
test('add on click', () async {
final address = 'ws://host:1234';
final address = 'ws://host:1234/ws';
final list = <TargetMock>[const TargetMock(name: 't-1')];
final targets = new TargetRepositoryMock(list: list,
add: expectAsync((String val) {