<commit_before><!doctype html>

<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../../web-component-tester/browser.js"></script>
  <script src="../../iron-test-helpers/mock-interactions.js"></script>

  <link rel="import" href="helpers.html">
  <link rel="import" href="../vaadin-grid.html">
</head>

<body>

  <test-fixture id="two-columns">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>foo</template>
        </vaadin-grid-column>
        <vaadin-grid-column>
          <template>foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="smaller-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div style="line-height: 0.5em">[[item]]</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="default-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div>foobar</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="higher-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div style="line-height: 2em">[[item]]</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="higher-default-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div style="line-height: 2em">foobar</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <script>
    describe('rows', function() {

      var grid, scroller, rows, defaultHeight, wrappers;
      var dataSourceDelay = 100;

      var ds = function(info, callback) {

        setTimeout(function() {
          if (grid) {
            var result = [];
            for (var i = 0; i < info.pageSize; i++) {
              result.push('foo');
            }
            callback(result);

            grid.async(function() {
              grid.fire('items-assigned');
            }, 10); // TODO: Fix async
          }
        }, dataSourceDelay);
      };

      function init(fixtureName) {
        grid = fixture(fixtureName);

        var listener = function() {
          if (grid.onItemsAssigned) {
            grid.onItemsAssigned();
          }
          delete grid.onItemsAssigned;
        };
        grid.addEventListener('items-assigned', listener);

        scroller = grid.$.scroller;
        rows = getRows(scroller.$.items);
        defaultHeight = getRowCells(getRows(grid.$.scroller.$.header)[0])[0].clientHeight + 1;
        grid.dataSource = ds;<commit_msg>Test cleanup<commit_after><!doctype html>

<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../../web-component-tester/browser.js"></script>
  <script src="../../iron-test-helpers/mock-interactions.js"></script>

  <link rel="import" href="helpers.html">
  <link rel="import" href="../vaadin-grid.html">
</head>

<body>

  <test-fixture id="two-columns">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>foo</template>
        </vaadin-grid-column>
        <vaadin-grid-column>
          <template>foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="smaller-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div style="line-height: 0.5em">[[item.index]]</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="default-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div>foobar</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="higher-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div style="line-height: 2em">[[item.index]]</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <test-fixture id="higher-default-content">
    <template>
      <vaadin-grid style="width: 200px; height: 200px;" size="10000">
        <vaadin-grid-column>
          <template>
            <div style="line-height: 2em">foobar</div>
          </template>
          <template is="header">foo</template>
        </vaadin-grid-column>
      </vaadin-grid>
    </template>
  </test-fixture>

  <script>
    describe('rows', function() {

      var grid, scroller, rows, defaultHeight, wrappers;
      var dataSourceDelay = 100;

      function init(fixtureName) {
        grid = fixture(fixtureName);

        var listener = function() {
          if (grid.onItemsAssigned) {
            grid.onItemsAssigned();
          }
          delete grid.onItemsAssigned;
        };
        grid.addEventListener('items-assigned', listener);

        scroller = grid.$.scroller;
        rows = getRows(scroller.$.items);
        defaultHeight = getRowCells(getRows(grid.$.scroller.$.header)[0])[0].clientHeight + 1;
        grid.dataSource = function(info, callback) {
          setTimeout(function() {
            var startIndex = info.pageSize * info.page;
            callback(buildDataSet(startIndex + info.pageSize).splice(startIndex));

            grid.async(function() {
              grid.fire('items-assigned');
            }, 10);
          }, dataSourceDelay);
        };
{'fraction_non_alphanumeric': 0.16913815886066658, 'fraction_numerical': 0.02128909117603876, 'mean_word_length': 2.2531041069723017, 'pattern_counts': {'":': 0, '<': 176, '<?xml version=': 0, '>': 175, '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': '769951', 'n_tokens_mistral': 2319, 'n_tokens_neox': 2111, 'n_words': 357}