| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | |
| 3 Use of this source code is governed by a BSD-style license that can be | |
| 4 found in the LICENSE file. | |
| 5 --> | |
| 6 | |
| 7 <link rel="import" href="ct-commit-list.html"> | |
| 8 | |
| 9 <link rel="import" href="../model/ct-commit-log-mock.html"> | |
| 10 | |
| 11 <script> | |
| 12 (function () { | |
| 13 | |
| 14 module("ct-commit-list"); | |
| 15 | |
| 16 asyncTest("basic", 1, function() { | |
| 17 var list = document.createElement('ct-commit-list'); | |
| 18 | |
| 19 list.commits = new CTCommitLogMock(); | |
| 20 | |
| 21 // FIXME: This test shouldn't rely on firstRevision being empty to pass. | |
| 22 list.commits.firstRevision = {}; | |
| 23 | |
| 24 var blinkCommits = list.commits.commits.blink; | |
| 25 var revision; | |
| 26 for (revision in blinkCommits) | |
| 27 break; | |
| 28 | |
| 29 var numCommits = 2; | |
| 30 | |
| 31 list.first = {blink: revision}; | |
| 32 list.last = {blink: Number(revision) + numCommits}; | |
| 33 | |
| 34 requestAnimationFrame(function() { | |
| 35 var commits = list.shadowRoot.querySelectorAll('ct-commit'); | |
| 36 equal(commits.length, numCommits); | |
| 37 | |
| 38 start(); | |
| 39 }); | |
| 40 }); | |
| 41 | |
| 42 asyncTest("backwards", 1, function() { | |
| 43 var list = document.createElement('ct-commit-list'); | |
| 44 | |
| 45 list.commits = new CTCommitLogMock(); | |
| 46 | |
| 47 var blinkCommits = list.commits.commits.blink; | |
| 48 var revision; | |
| 49 for (revision in blinkCommits) | |
| 50 break; | |
| 51 | |
| 52 list.first = {blink: revision}; | |
| 53 list.last = {blink: Number(revision) - 1}; | |
| 54 | |
| 55 requestAnimationFrame(function() { | |
| 56 var commits = list.shadowRoot.querySelectorAll('ct-commit'); | |
| 57 equal(commits.length, 0); | |
| 58 | |
| 59 start(); | |
| 60 }); | |
| 61 }); | |
| 62 | |
| 63 })() | |
| 64 </script> | |
| OLD | NEW |