<commit_before><!doctype html>
<!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
  <meta charset="utf-8">
  <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../../../web-component-tester/browser.js"></script>
  <link rel="import" href="../../polymer.html">
  <link rel="import" href="dom-bind-elements1.html">
</head>
<body>

  <template is="dom-bind" id="decDomBind">
    <x-basic id="decEl1" value="{{value}}" notifyingvalue="{{nvalue}}" on-custom="handleEvent" computed="{{compute(dep)}}"></x-basic>
    <x-basic id="decEl2" value="{{value}}" notifyingvalue="{{nvalue}}"></x-basic>
  </template>

  <div id="container">
  </div>

  <template is="dom-bind" id="timingDomBind" config="config">
    <x-needs-host id="needsHost"></x-needs-host>
  </template>

  <script>

    suite('declarative dom-bind', function() {

      var domBind;
      var el1;
      var el2;

      setup(function() {
        domBind = decDomBind;
        el1 = decEl1;
        el2 = decEl2;
      });

      test('value binds top-down', function() {
        domBind.value = 'foo';
        assert.equal(el1.value, 'foo');
        assert.equal(el2.value, 'foo');
      });

      test('notifyingvalue binds from child to child', function() {
        el1.notifyingvalue = 'bar';
        assert.equal(domBind.nvalue, 'bar');
        assert.equal(el2.notifyingvalue, 'bar');
      });

      test('event listener fires', function() {
        var count = 0;
        domBind.handleEvent = function() {
          count++;
        };<commit_msg>Add test for early interaction with don-bind.<commit_after><!doctype html>
<!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
  <meta charset="utf-8">
  <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../../../web-component-tester/browser.js"></script>
</head>
<body>

  <template is="dom-bind" id="earlyDomBind">
    <div id="earlyBoundChild">{{value}}</div>
  </template>

  <script>
    earlyDomBind.value = 'hi!';
  </script>

  <link rel="import" href="../../polymer.html">
  <link rel="import" href="dom-bind-elements1.html">

  <template is="dom-bind" id="decDomBind">
    <x-basic id="decEl1" value="{{value}}" notifyingvalue="{{nvalue}}" on-custom="handleEvent" computed="{{compute(dep)}}"></x-basic>
    <x-basic id="decEl2" value="{{value}}" notifyingvalue="{{nvalue}}"></x-basic>
  </template>

  <div id="container">
  </div>

  <template is="dom-bind" id="timingDomBind" config="config">
    <x-needs-host id="needsHost"></x-needs-host>
  </template>

  <script>

    suite('dom-bind touched before upgrade', function() {

      test('value binds top-down', function() {
        assert.equal(earlyBoundChild.textContent, 'hi!');
      });

    });

    suite('declarative dom-bind', function() {

      var domBind;
      var el1;
      var el2;

      setup(function() {
        domBind = decDomBind;
        el1 = decEl1;
        el2 = decEl2;
      });

      test('value binds top-down', function() {
        domBind.value = 'foo';
        assert.equal(el1.value, 'foo');
        assert.equal(el2.value, 'foo');
      });

      test('notifyingvalue binds from child to child', function() {
        el1.notifyingvalue = 'bar';
        assert.equal(domBind.nvalue, 'bar');
        assert.equal(el2.notifyingvalue, 'bar');
      });

      test('event listener fires', function() {
        var count = 0;
        domBind.handleEvent = function() {
          count++;
        };
{'fraction_non_alphanumeric': 0.17050067658998647, 'fraction_numerical': 0.008570139828597204, 'mean_word_length': 3.114100185528757, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '203638', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1344, 'n_words': 345}