2 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
31 var kSearchResults = {
32 "cursor": "long_string_we_call_cursor",
35 "description": "Blink roll 151668:151677\n\nhttp:\/\/build.chromium.org\/f\/chromium\/perf\/dashboard\/ui\/changelog_blink.html?url=\/trunk&range=151669:151677&mode=html\nTBR=\nBUG=",
37 "chromium-reviews@chromium.org",
43 "sender": "eseidel@chromium.org",
45 "eseidel@chromium.org",
46 "chromium-reviews@chromium.org",
48 "text": "This roll was automatically created by the Blink AutoRollBot (crbug.com\/242461).\nInclude STOP in this message, but should be ignored.",
50 "date": "2013-06-03 18:14:34.033780",
54 "owner_email": "eseidel@chromium.org",
56 "base_url": "https:\/\/chromium.googlesource.com\/chromium\/src.git@master",
58 "subject": "Blink roll 151668:151677",
59 "created": "2013-06-03 18:14:28.926040",
63 "modified": "2013-06-03 18:14:46.869990",
69 "description": "Add --json-output option to layout_test_wrapper.py\n\nBUG=238381",
71 "chromium-reviews@chromium.org",
74 "iannucci@chromium.org"
78 "sender": "eseidel@chromium.org",
80 "eseidel@chromium.org",
81 "chromium-reviews@chromium.org",
83 "text": "I'm not quite sure how to test this code.\n\nI'm also ",
85 "date": "2013-05-30 23:42:39.309160",
94 "description": "Blink roll 152079:152080\n\nhttp:\/\/build.chromium.org\/f\/chromium\/perf\/dashboard\/ui\/changelog_blink.html?url=\/trunk&range=152080:152080&mode=html\nTBR=\nBUG=",
96 "chromium-reviews@chromium.org",
97 "none (channel is sheriff)@chromium.org"
104 "sender": "eseidel@chromium.org",
106 "eseidel@chromium.org",
107 "chromium-reviews@chromium.org",
109 "text": "This string has STOP in it, but should be ignored as the first message.",
110 "date": "2013-06-09 06:47:35.825820",
113 "sender": "commit-bot@chromium.org",
115 "eseidel@chromium.org",
116 "chromium-reviews@chromium.org",
118 "text": "CQ is trying da patch. Follow status at\nhttps:\/\/chromium-status.appspot.com\/cq\/eseidel@chromium.org\/16606004\/1",
119 "date": "2013-06-09 06:47:45.529170",
122 "sender": "ilevy@chromium.org",
124 "eseidel@chromium.org",
125 "ilevy@chromium.org",
126 "chromium-reviews@chromium.org",
129 "date": "2013-06-09 07:59:48.280360",
132 "sender": "eseidel@chromium.org",
134 "eseidel@chromium.org",
135 "ilevy@chromium.org",
136 "chromium-reviews@chromium.org",
138 "text": "Rollbot was stopped by the presence of \"STOP\" in an earlier comment on this issue.\n",
139 "date": "2013-06-10 19:35:44.710470",
142 "owner_email": "eseidel@chromium.org",
144 "base_url": "https:\/\/chromium.googlesource.com\/chromium\/src.git@master",
146 "subject": "Blink roll 152079:152080",
147 "created": "2013-06-09 06:47:31.518010",
151 "modified": "2013-06-10 19:56:59.618710",
157 asyncTest("fetchCurrentRoll", 6, function() {
158 var simulator = new NetworkSimulator();
159 simulator.json = function(url)
161 return Promise.resolve(kSearchResults);
164 simulator.runTest(function() {
165 rollbot.fetchCurrentRoll().then(function(roll) {
166 equals(roll.issue, 16337011);
167 equals(roll.url, "https://codereview.chromium.org/16337011");
168 equals(roll.isStopped, false);
169 equals(roll.fromRevision, "151668");
170 equals(roll.toRevision, "151677");
175 test("_isRollbotStopped", 1, function() {
176 equals(true, rollbot._isRollbotStopped(kStoppedIssue));