| Index: Tools/GardeningServer/model/test/ct-commit-log-tests.html
|
| diff --git a/Tools/GardeningServer/model/test/ct-commit-log-tests.html b/Tools/GardeningServer/model/test/ct-commit-log-tests.html
|
| deleted file mode 100644
|
| index 056a070ad8e37a8433e8d4070a56f6f535b45d16..0000000000000000000000000000000000000000
|
| --- a/Tools/GardeningServer/model/test/ct-commit-log-tests.html
|
| +++ /dev/null
|
| @@ -1,82 +0,0 @@
|
| -<!--
|
| -Copyright 2014 The Chromium Authors. All rights reserved.
|
| -Use of this source code is governed by a BSD-style license that can be
|
| -found in the LICENSE file.
|
| --->
|
| -
|
| -<link rel="import" href="../ct-commit-log.html">
|
| -
|
| -<link rel="import" href="../ct-commit-mock.html">
|
| -
|
| -<script>
|
| -(function () {
|
| -
|
| -var assert = chai.assert;
|
| -
|
| -describe('ct-commit-log model', function() {
|
| - it('handles response', function() {
|
| - var commit = new CTCommitMock();
|
| - var exampleCommitData = ')]}\n' +
|
| - JSON.stringify({
|
| - "log": [
|
| - {
|
| - "commit": "068885c2c5fda617e634bb73a107a0285af470ff",
|
| - "tree": "750c92f0fe1294bdddbf00cc14378d0d440290cb",
|
| - "parents": [
|
| - "e6ba81e00ae835946e069e5bd80bd533b11d8442"
|
| - ],
|
| - "author": {
|
| - "name": commit.author,
|
| - "email": commit.author,
|
| - "time": "Tue Jul 17 17:10:47 2012"
|
| - },
|
| - "committer": {
|
| - "name": commit.author,
|
| - "email": commit.author,
|
| - "time": "Tue Jul 17 17:10:47 2012"
|
| - },
|
| - "message": commit.message,
|
| - }
|
| - ]
|
| - });
|
| -
|
| - var repositoryUrl = 'https://mockurl/?{revision}';
|
| - var repository = 'blink';
|
| -
|
| - var log = new CTCommitLog();
|
| - log._handleResponse(repositoryUrl, repository, exampleCommitData);
|
| -
|
| - var expectedCommits = {};
|
| - log._repositories.names.forEach(function(name) {
|
| - expectedCommits[name] = {};
|
| - });
|
| - expectedCommits[repository][commit.revision] = commit;
|
| - assert.deepEqual(log.commits, expectedCommits);
|
| -
|
| - var revisions = [commit.revision];
|
| - assert.deepEqual(log.range(repository, revisions), [commit]);
|
| -
|
| - // This url is different than the one above because CTCommitLog gets the url
|
| - // from CTRepositories.
|
| - var incompleteRepositoryUrl = log._repositories.repositories[repository].repositoryUrl;
|
| -
|
| - var nextRev = String(commit.revision + 1);
|
| - var incompleteCommitAfter =
|
| - CTCommit.createIncomplete(incompleteRepositoryUrl, nextRev, repository);
|
| - revisions.push(nextRev);
|
| - // Expect an incomplete commit for revision + 1.
|
| - assert.deepEqual(log.range(repository, revisions), [commit, incompleteCommitAfter]);
|
| -
|
| - // Expect two incomplete commits: one before and one after.
|
| - var prevRev = String(commit.revision - 1);
|
| - var incompleteCommitBefore =
|
| - CTCommit.createIncomplete(incompleteRepositoryUrl, prevRev, repository);
|
| - // Inserting at the beginning of the list.
|
| - revisions.splice(0, 0, prevRev);
|
| - assert.deepEqual(log.range(repository, revisions),
|
| - [incompleteCommitBefore, commit, incompleteCommitAfter]);
|
| - });
|
| -});
|
| -
|
| -})();
|
| -</script>
|
|
|