OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 }; | 155 }; |
156 | 156 |
157 asyncTest("fetchCurrentRoll", 6, function() { | 157 asyncTest("fetchCurrentRoll", 6, function() { |
158 var simulator = new NetworkSimulator(); | 158 var simulator = new NetworkSimulator(); |
159 simulator.json = function(url) | 159 simulator.json = function(url) |
160 { | 160 { |
161 return Promise.resolve(kSearchResults); | 161 return Promise.resolve(kSearchResults); |
162 }; | 162 }; |
163 | 163 |
164 simulator.runTest(function() { | 164 simulator.runTest(function() { |
165 rollbot.fetchCurrentRoll(function(roll) { | 165 rollbot.fetchCurrentRoll().then(function(roll) { |
166 equals(roll.issue, 16337011); | 166 equals(roll.issue, 16337011); |
167 equals(roll.url, "https://codereview.chromium.org/16337011"); | 167 equals(roll.url, "https://codereview.chromium.org/16337011"); |
168 equals(roll.isStopped, false); | 168 equals(roll.isStopped, false); |
169 equals(roll.fromRevision, "151668"); | 169 equals(roll.fromRevision, "151668"); |
170 equals(roll.toRevision, "151677"); | 170 equals(roll.toRevision, "151677"); |
171 }); | 171 }); |
172 }).then(start); | 172 }).then(start); |
173 }); | 173 }); |
174 | 174 |
175 test("_isRollbotStopped", 1, function() { | 175 test("_isRollbotStopped", 1, function() { |
176 equals(true, rollbot._isRollbotStopped(kStoppedIssue)); | 176 equals(true, rollbot._isRollbotStopped(kStoppedIssue)); |
177 }); | 177 }); |
178 | 178 |
179 })(); | 179 })(); |
OLD | NEW |