Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1387)

Unified Diff: Tools/GardeningServer/model/test/ct-commit-log-tests.html

Issue 485253004: [Sheriff-o-matic] Remove race condition on the commit list. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: names Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
index 4e40b786a4326eecbd1b77731aa9cdb3a93631a5..eea8e849312055b7b265a684f2c2ab2d1a32a4e0 100644
--- a/Tools/GardeningServer/model/test/ct-commit-log-tests.html
+++ b/Tools/GardeningServer/model/test/ct-commit-log-tests.html
@@ -47,17 +47,25 @@ describe('ct-commit-log model', function() {
log._handleResponse(repositoryUrl, repository, exampleCommitData);
var expectedCommits = {};
- expectedCommits[repository] = {};
+ log._repositories.names.forEach(function(name) {
+ expectedCommits[name] = {};
+ });
expectedCommits[repository][commit.revision] = commit;
assert.deepEqual(log.commits, expectedCommits);
assert.deepEqual(log.range(repository, commit.revision, commit.revision), [commit]);
- assert.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);
- assert.deepEqual(log.range(repository, commit.revision - 1, commit.revision + 1), [incompleteCommit, commit]);
+ var incompleteCommitAfter = CTCommit.createIncomplete(incompleteRepositoryUrl, commit.revision + 1, repository);
+ // Expect an incomplete commit for revision + 1.
+ assert.deepEqual(log.range(repository, commit.revision, commit.revision + 1), [commit, incompleteCommitAfter]);
+
+ // Expect two incomplete commits: one before and one after.
+ var incompleteCommitBefore = CTCommit.createIncomplete(incompleteRepositoryUrl, commit.revision - 1, repository);
+ assert.deepEqual(log.range(repository, commit.revision - 1, commit.revision + 1),
+ [incompleteCommitBefore, commit, incompleteCommitAfter]);
});
});
« no previous file with comments | « Tools/GardeningServer/model/test/ct-commit-list-tests.html ('k') | Tools/GardeningServer/ui/ct-commit-list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698