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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!-- 1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved. 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 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 --> 5 -->
6 6
7 <link rel="import" href="../ct-commit-log.html"> 7 <link rel="import" href="../ct-commit-log.html">
8 8
9 <link rel="import" href="../ct-commit-mock.html"> 9 <link rel="import" href="../ct-commit-mock.html">
10 10
(...skipping 29 matching lines...) Expand all
40 ] 40 ]
41 }); 41 });
42 42
43 var repositoryUrl = 'http://mockurl/?{revision}'; 43 var repositoryUrl = 'http://mockurl/?{revision}';
44 var repository = 'blink'; 44 var repository = 'blink';
45 45
46 var log = new CTCommitLog(); 46 var log = new CTCommitLog();
47 log._handleResponse(repositoryUrl, repository, exampleCommitData); 47 log._handleResponse(repositoryUrl, repository, exampleCommitData);
48 48
49 var expectedCommits = {}; 49 var expectedCommits = {};
50 expectedCommits[repository] = {}; 50 log._repositories.names.forEach(function(name) {
51 expectedCommits[name] = {};
52 });
51 expectedCommits[repository][commit.revision] = commit; 53 expectedCommits[repository][commit.revision] = commit;
52 assert.deepEqual(log.commits, expectedCommits); 54 assert.deepEqual(log.commits, expectedCommits);
53 55
54 assert.deepEqual(log.range(repository, commit.revision, commit.revision), [c ommit]); 56 assert.deepEqual(log.range(repository, commit.revision, commit.revision), [c ommit]);
55 assert.deepEqual(log.range(repository, commit.revision, commit.revision + 1) , [commit]); 57
56 // This url is different than the one obove because CTCommitLog gets the url 58 // This url is different than the one obove because CTCommitLog gets the url
57 // from CTRepositories. 59 // from CTRepositories.
58 var incompleteRepositoryUrl = log._repositories.repositories[repository].rep ositoryUrl; 60 var incompleteRepositoryUrl = log._repositories.repositories[repository].rep ositoryUrl;
59 var incompleteCommit = CTCommit.createIncomplete(incompleteRepositoryUrl, co mmit.revision - 1, repository); 61 var incompleteCommitAfter = CTCommit.createIncomplete(incompleteRepositoryUr l, commit.revision + 1, repository);
60 assert.deepEqual(log.range(repository, commit.revision - 1, commit.revision + 1), [incompleteCommit, commit]); 62 // Expect an incomplete commit for revision + 1.
63 assert.deepEqual(log.range(repository, commit.revision, commit.revision + 1) , [commit, incompleteCommitAfter]);
64
65 // Expect two incomplete commits: one before and one after.
66 var incompleteCommitBefore = CTCommit.createIncomplete(incompleteRepositoryU rl, commit.revision - 1, repository);
67 assert.deepEqual(log.range(repository, commit.revision - 1, commit.revision + 1),
68 [incompleteCommitBefore, commit, incompleteCommitAfter]);
61 }); 69 });
62 }); 70 });
63 71
64 })(); 72 })();
65 </script> 73 </script>
OLDNEW
« 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