| Index: Tools/GardeningServer/model/ct-commit-log-tests.html
|
| diff --git a/Tools/GardeningServer/model/ct-commit-log-tests.html b/Tools/GardeningServer/model/ct-commit-log-tests.html
|
| index 030923a1a00cf7f4b7e5cf314aa7ff86cbd92aa5..fcffdc092e14a362d27542267a85c77ef11a4297 100644
|
| --- a/Tools/GardeningServer/model/ct-commit-log-tests.html
|
| +++ b/Tools/GardeningServer/model/ct-commit-log-tests.html
|
| @@ -13,31 +13,50 @@ found in the LICENSE file.
|
|
|
| module("ct-commit-log");
|
|
|
| -test("basic", 1, function() {
|
| +test("basic", 4, function() {
|
| var commit = new CTCommitMock();
|
| - var kExampleCommitDataXML =
|
| - "<feed xmlns='http://www.w3.org/2005/Atom'>\n" +
|
| - "<title>blink, branch master</title>\n" +
|
| - "<subtitle>Mirror of the Chromium Blink repository.</subtitle>\n" +
|
| - "<link rel='alternate' type='text/html' href='http://blink.lc/blink/'/>\n" +
|
| - "<entry>\n" +
|
| - "<title>Throw SecurityError when setting 'Replaceable' properties cross-origin.</title>\n" +
|
| - "<updated>2013-09-30T20:22:01Z</updated>\n" +
|
| - "<author>\n" +
|
| - "<name>" + commit.author + "</name>\n" +
|
| - "</author>\n" +
|
| - "<published>2013-09-30T20:22:01Z</published>\n" +
|
| - "<link rel='alternate' type='text/html' href='http://blink.lc/blink/commit/?id=723e62a4a4e093435b4772b4839aa3fd7cf6b991'/>\n" +
|
| - "<id>723e62a4a4e093435b4772b4839aa3fd7cf6b991</id>\n" +
|
| - "<content type='text'>\n" + commit.message + "</content>\n";
|
| -
|
| - var xml = new DOMParser().parseFromString(kExampleCommitDataXML, "text/xml");
|
| + var exampleCommitData = ')]}\n' +
|
| + JSON.stringify({
|
| + "log": [
|
| + {
|
| + "commit": "068885c2c5fda617e634bb73a107a0285af470ff",
|
| + "tree": "750c92f0fe1294bdddbf00cc14378d0d440290cb",
|
| + "parents": [
|
| + "e6ba81e00ae835946e069e5bd80bd533b11d8442"
|
| + ],
|
| + "author": {
|
| + "name": commit.author,
|
| + "email": commit.author + "@0039d316-1c4b-4281-b951-d872f2087c98",
|
| + "time": "Tue Jul 17 17:10:47 2012"
|
| + },
|
| + "committer": {
|
| + "name": commit.author,
|
| + "email": commit.author + "@0039d316-1c4b-4281-b951-d872f2087c98",
|
| + "time": "Tue Jul 17 17:10:47 2012"
|
| + },
|
| + "message": commit.message,
|
| + }
|
| + ]
|
| + });
|
| +
|
| + var repositoryUrl = 'http://mockurl/?{revision}';
|
| + var repository = 'blink';
|
| +
|
| var log = new CTCommitLog();
|
| - log._processXml(xml);
|
| + log._handleResponse(repositoryUrl, repository, exampleCommitData);
|
|
|
| var expectedCommits = {};
|
| - expectedCommits[commit.revision] = commit;
|
| + expectedCommits[repository] = {};
|
| + expectedCommits[repository][commit.revision] = commit;
|
| deepEqual(log.commits, expectedCommits);
|
| +
|
| + deepEqual(log.range(repository, commit.revision, commit.revision), [commit]);
|
| + deepEqual(log.range(repository, commit.revision, commit.revision + 1), [commit]);
|
| + // This url is different than the one obove because CTCommitLog gets the url
|
| + // from CTRepositories.
|
| + var incompleteRepositoryUrl = log._repositories.repositories[repository].repositoryUrl;
|
| + var incompleteCommit = CTCommit.createIncomplete(incompleteRepositoryUrl, commit.revision - 1, repository);
|
| + deepEqual(log.range(repository, commit.revision - 1, commit.revision + 1), [incompleteCommit, commit]);
|
| });
|
|
|
| })();
|
|
|