// Copyright (c) 2013, 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.

library polymer.test.nested_binding_test;

import 'dart:async';
import 'dart:html';
import 'package:polymer/polymer.dart';
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';

@CustomTag('my-test')
class MyTest extends PolymerElement {
  final List fruits = toObservable(['apples', 'oranges', 'pears']);

  final _testDone = new Completer();

  MyTest.created() : super.created();

  _runTest(_) {
    expect($['fruit'].text.trim(), 'Short name: [pears]');
    _testDone.complete();
  }

  ready() {
    onMutation($['fruit']).then(_runTest);
  }
}

main() => initPolymer().run(() {
  useHtmlConfiguration();

  setUp(() => Polymer.onReady);

  test('ready called',
      () => (querySelector('my-test') as MyTest)._testDone.future);
});

// Copyright (c) 2013, 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.

library polymer.test.nested_binding_test;

import 'dart:async';
import 'dart:html';
import 'package:polymer/polymer.dart';
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';

@CustomTag('my-test')
class MyTest extends PolymerElement {
  final List fruits = toObservable(['apples', 'oranges', 'pears']);

  final _testDone = new Completer();

  MyTest.created() : super.created();

  ready() {
    expect($['fruit'].text.trim(), 'Short name: [pears]');
    _testDone.complete();
  }
}

main() => initPolymer().run(() {
  useHtmlConfiguration();

  setUp(() => Polymer.onReady);

  test('ready called',
      () => (querySelector('my-test') as MyTest)._testDone.future);
});

Remove comprehension object, but return the list of scopes directly instead.
Remove comprehension object, but return the list of scopes directly instead.

This is to fix https://code.google.com/p/dart/issues/detail?id=18792:
creating a new list of scopes on every invocation to _convertValue was causing us to issue extra notifications, which in turn caused the bug with <select> in that bug.

R=jmesserly@google.com, justinfagnani@google.com

Review URL: https://codereview.chromium.org//304223004

git-svn-id: 0aa7e0b98478d6ef7145d04e8154f8ab2209deba@36848 260f80e4-7a28-3924-810f-c04153c831b5
