Commit a5ee1838 authored by ojan@chromium.org's avatar ojan@chromium.org

Delete dead code now that the polymer port of garden-o-matic is done.

NOTRY=true

Review URL: https://codereview.chromium.org/405853002

git-svn-id: svn://svn.chromium.org/blink/trunk@178527 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b42f3a10
...@@ -48,8 +48,6 @@ THE POSSIBILITY OF SUCH DAMAGE. ...@@ -48,8 +48,6 @@ THE POSSIBILITY OF SUCH DAMAGE.
<script src="scripts/base_unittests.js"></script> <script src="scripts/base_unittests.js"></script>
<script src="scripts/net.js"></script> <script src="scripts/net.js"></script>
<script src="scripts/net_unittests.js"></script> <script src="scripts/net_unittests.js"></script>
<script src="scripts/rollbot.js"></script>
<script src="scripts/rollbot_unittests.js"></script>
<script src="scripts/svn-log.js"></script> <script src="scripts/svn-log.js"></script>
<script src="scripts/svn-log_unittests.js"></script> <script src="scripts/svn-log_unittests.js"></script>
<script src="scripts/treestatus.js"></script> <script src="scripts/treestatus.js"></script>
...@@ -59,7 +57,6 @@ THE POSSIBILITY OF SUCH DAMAGE. ...@@ -59,7 +57,6 @@ THE POSSIBILITY OF SUCH DAMAGE.
<script src="scripts/results.js"></script> <script src="scripts/results.js"></script>
<script src="scripts/results_unittests.js"></script> <script src="scripts/results_unittests.js"></script>
<script src="scripts/ui.js"></script> <script src="scripts/ui.js"></script>
<script src="scripts/ui_unittests.js"></script>
<script src="scripts/model.js"></script> <script src="scripts/model.js"></script>
<script src="scripts/model_unittests.js"></script> <script src="scripts/model_unittests.js"></script>
......
...@@ -42,14 +42,6 @@ base.joinPath = function(parent, child) ...@@ -42,14 +42,6 @@ base.joinPath = function(parent, child)
return parent + '/' + child; return parent + '/' + child;
}; };
base.dirName = function(path)
{
var directoryIndex = path.lastIndexOf('/');
if (directoryIndex == -1)
return path;
return path.substr(0, directoryIndex);
};
base.trimExtension = function(url) base.trimExtension = function(url)
{ {
var index = url.lastIndexOf('.'); var index = url.lastIndexOf('.');
...@@ -71,27 +63,6 @@ base.uniquifyArray = function(array) ...@@ -71,27 +63,6 @@ base.uniquifyArray = function(array)
return result; return result;
}; };
base.flattenArray = function(arrayOfArrays)
{
if (!arrayOfArrays.length)
return [];
return arrayOfArrays.reduce(function(left, right) {
return left.concat(right);
});
};
base.filterDictionary = function(dictionary, predicate)
{
var result = {};
for (var key in dictionary) {
if (predicate(key))
result[key] = dictionary[key];
}
return result;
};
base.filterTree = function(tree, isLeaf, predicate) base.filterTree = function(tree, isLeaf, predicate)
{ {
var filteredTree = {}; var filteredTree = {};
...@@ -114,20 +85,6 @@ base.filterTree = function(tree, isLeaf, predicate) ...@@ -114,20 +85,6 @@ base.filterTree = function(tree, isLeaf, predicate)
return filteredTree; return filteredTree;
}; };
base.forEachDirectory = function(pathList, callback)
{
var pathsByDirectory = {};
pathList.forEach(function(path) {
var directory = base.dirName(path);
pathsByDirectory[directory] = pathsByDirectory[directory] || [];
pathsByDirectory[directory].push(path);
});
Object.keys(pathsByDirectory).sort().forEach(function(directory) {
var paths = pathsByDirectory[directory];
callback(directory + ' (' + paths.length + ' tests)', paths);
});
};
base.parseJSONP = function(jsonp) base.parseJSONP = function(jsonp)
{ {
if (!jsonp) if (!jsonp)
...@@ -168,69 +125,6 @@ base.AsynchronousCache.prototype.clear = function() ...@@ -168,69 +125,6 @@ base.AsynchronousCache.prototype.clear = function()
this._promiseCache = {}; this._promiseCache = {};
}; };
/*
Maintains a dictionary of items, tracking their updates and removing items that haven't been updated.
An "update" is a call to the "update" method.
To remove stale items, call the "remove" method. It will remove all
items that have not been been updated since the last call of "remove".
*/
base.UpdateTracker = function()
{
this._items = {};
this._updated = {};
}
base.UpdateTracker.prototype = {
/*
Update an {key}/{item} pair. You can make the dictionary act as a set and
skip the {item}, in which case the {key} is also the {item}.
*/
update: function(key, object)
{
object = object || key;
this._items[key] = object;
this._updated[key] = 1;
},
exists: function(key)
{
return !!this.get(key);
},
get: function(key)
{
return this._items[key];
},
length: function()
{
return Object.keys(this._items).length;
},
/*
Callback parameters are:
- item
- key
- updated, which is true if the item was updated after last purge() call.
*/
forEach: function(callback, thisObject)
{
if (!callback)
return;
Object.keys(this._items).sort().forEach(function(key) {
var item = this._items[key];
callback.call(thisObject || item, item, key, !!this._updated[key]);
}, this);
},
purge: function(removeCallback, thisObject) {
removeCallback = removeCallback || function() {};
this.forEach(function(item, key, updated) {
if (updated)
return;
removeCallback.call(thisObject || item, item);
delete this._items[key];
}, this);
this._updated = {};
}
}
// Based on http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/resources/shared/js/cr/ui.js // Based on http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/resources/shared/js/cr/ui.js
base.extends = function(base, prototype) base.extends = function(base, prototype)
{ {
...@@ -248,14 +142,6 @@ base.extends = function(base, prototype) ...@@ -248,14 +142,6 @@ base.extends = function(base, prototype)
return extended; return extended;
} }
base.getURLParameter = function(name)
{
var match = RegExp(name + '=' + '(.+?)(&|$)').exec(location.search);
if (!match)
return null;
return decodeURI(match[1])
}
base.underscoredBuilderName = function(builderName) base.underscoredBuilderName = function(builderName)
{ {
return builderName.replace(/[ .()]/g, '_'); return builderName.replace(/[ .()]/g, '_');
......
...@@ -58,12 +58,6 @@ test("joinPath with empty parent", 1, function() { ...@@ -58,12 +58,6 @@ test("joinPath with empty parent", 1, function() {
equals(value, "test.html"); equals(value, "test.html");
}); });
test("dirName", 3, function() {
equals(base.dirName("foo.html"), "foo.html");
equals(base.dirName("foo/bar.html"), "foo");
equals(base.dirName("foo/bar/baz.html"), "foo/bar");
});
test("uniquifyArray", 5, function() { test("uniquifyArray", 5, function() {
deepEqual(base.uniquifyArray([]), []); deepEqual(base.uniquifyArray([]), []);
deepEqual(base.uniquifyArray(["a"]), ["a"]); deepEqual(base.uniquifyArray(["a"]), ["a"]);
...@@ -72,29 +66,6 @@ test("uniquifyArray", 5, function() { ...@@ -72,29 +66,6 @@ test("uniquifyArray", 5, function() {
deepEqual(base.uniquifyArray(["a", "b", "b", "a"]), ["a", "b"]); deepEqual(base.uniquifyArray(["a", "b", "b", "a"]), ["a", "b"]);
}); });
test("flattenArray", 5, function() {
deepEqual(base.flattenArray([]), []);
deepEqual(base.flattenArray([["a"]]), ["a"]);
deepEqual(base.flattenArray([["a"], ["b"]]), ["a", "b"]);
deepEqual(base.flattenArray([["a"], ["b", "c"]]), ["a", "b", "c"]);
deepEqual(base.flattenArray([["a"], [], ["b"]]), ["a", "b"]);
});
test("filterDictionary", 3, function() {
var dictionary = {
'foo': 43,
'bar': 11
};
deepEqual(base.filterDictionary(dictionary, function() { return true; }), {
"foo": 43,
"bar": 11
});
deepEqual(base.filterDictionary(dictionary, function() { return false; }), { });
deepEqual(base.filterDictionary(dictionary, function(key) { return key == 'foo'; }), {
"foo": 43
});
});
test("filterTree", 2, function() { test("filterTree", 2, function() {
var tree = { var tree = {
'path': { 'path': {
...@@ -142,83 +113,6 @@ test("filterTree", 2, function() { ...@@ -142,83 +113,6 @@ test("filterTree", 2, function() {
}); });
}); });
test("UpdateTracker", 20, function() {
var dict;
function dumpKeys()
{
var updates = []
dict.forEach(function(item, key, updated) {
updates.push(key);
});
return updates;
}
function dumpUpdatedKeys()
{
var updates = []
dict.forEach(function(item, key, updated) {
updated && updates.push(key);
});
return updates;
}
dict = new base.UpdateTracker();
dict.update("5", {});
deepEqual(dumpUpdatedKeys(), ["5"]);
dict.update("6", {});
dict.update("7", {});
deepEqual(dumpUpdatedKeys(), ["5", "6", "7"]);
deepEqual(dict.get("6"), {});
ok(dict.exists("7"));
dict.purge();
deepEqual(dumpUpdatedKeys(), []);
deepEqual(dumpKeys(), ["5", "6", "7"]);
dict.update("5", {});
deepEqual(dumpUpdatedKeys(), ["5"]);
dict.update("4", {});
deepEqual(dumpUpdatedKeys(), ["4", "5"]);
deepEqual(dumpKeys(), ["4", "5", "6", "7"]);
dict.purge();
deepEqual(dumpKeys(), ["4", "5"]);
deepEqual(dumpUpdatedKeys(), []);
dict.purge();
deepEqual(dumpKeys(), []);
var removeCount = 0;
dict.update("one");
deepEqual(dumpUpdatedKeys(), ["one"]);
dict.update("two");
deepEqual(dumpUpdatedKeys(), ["one", "two"]);
dict.update("three");
dict.purge();
deepEqual(dumpKeys(), ["one", "three", "two"]);
dict.update("two");
dict.purge(function() {
removeCount++;
});
deepEqual(dumpKeys(), ["two"]);
equal(removeCount, 2);
dict.update("four");
var removeCounter = { count: 0 };
dict.purge(function() {
this.count++;
}, removeCounter);
equal(removeCounter.count, 1);
dict.purge(function() {
equal(String(this), "four");
});
dict = new base.UpdateTracker();
dict.update("one");
var thisObject = {}
dict.forEach(function(item) {
equal(this, thisObject);
}, thisObject);
});
test("extends", 14, function() { test("extends", 14, function() {
var LikeDiv = base.extends("div", { var LikeDiv = base.extends("div", {
...@@ -296,10 +190,6 @@ test("extends", 14, function() { ...@@ -296,10 +190,6 @@ test("extends", 14, function() {
document.body.removeChild(document.body.lastChild); document.body.removeChild(document.body.lastChild);
}); });
test("getURLParameter", 1, function() {
ok(!base.getURLParameter('non-existant'));
});
test("parseJSONP", 6, function() { test("parseJSONP", 6, function() {
deepEqual(base.parseJSONP(""), {}); deepEqual(base.parseJSONP(""), {});
deepEqual(base.parseJSONP('p({"key": "value"})'), {"key": "value"}); deepEqual(base.parseJSONP('p({"key": "value"})'), {"key": "value"});
......
...@@ -28,14 +28,9 @@ var config = config || {}; ...@@ -28,14 +28,9 @@ var config = config || {};
(function() { (function() {
config = { config = {
kTreeStatusUpdateFrequency: 1000 * 30, kUpdateFrequency: 1000 * 30,
kUpdateFrequency: 10 * 60 * 1000,
kBlinkRevisionURL: 'http://src.chromium.org/viewvc/blink', kBlinkRevisionURL: 'http://src.chromium.org/viewvc/blink',
kRietveldURL: 'https://codereview.chromium.org',
buildConsoleURL: 'http://build.chromium.org/p/chromium.webkit', buildConsoleURL: 'http://build.chromium.org/p/chromium.webkit',
layoutTestResultsURL: 'https://storage.googleapis.com/chromium-layout-test-archives', layoutTestResultsURL: 'https://storage.googleapis.com/chromium-layout-test-archives',
waterfallURL: 'http://build.chromium.org/p/chromium.webkit/waterfall', waterfallURL: 'http://build.chromium.org/p/chromium.webkit/waterfall',
builders: { builders: {
...@@ -64,7 +59,6 @@ config = { ...@@ -64,7 +59,6 @@ config = {
return builderName.indexOf('GPU') == -1 && return builderName.indexOf('GPU') == -1 &&
builderName.indexOf('Oilpan') == -1; builderName.indexOf('Oilpan') == -1;
}, },
useLocalResults: !!base.getURLParameter('useLocalResults') || false,
}; };
})(); })();
...@@ -111,33 +111,6 @@ model.buildersInFlightForRevision = function(revision) ...@@ -111,33 +111,6 @@ model.buildersInFlightForRevision = function(revision)
return builders; return builders;
}; };
model.latestRevision = function()
{
return model.state.recentCommits[0].revision;
};
model.latestRevisionWithNoBuildersInFlight = function()
{
var revision = 0;
Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
var results = model.state.resultsByBuilder[builderName];
if (!results.blink_revision)
return;
var testedRevision = parseInt(results.blink_revision);
revision = revision ? Math.min(revision, testedRevision) : testedRevision;
});
return revision;
}
model.latestRevisionByBuilder = function()
{
var revision = {};
Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
revision[builderName] = model.state.resultsByBuilder[builderName].blink_revision;
});
return revision;
}
model.updateResultsByBuilder = function() model.updateResultsByBuilder = function()
{ {
return results.fetchResultsByBuilder(Object.keys(config.builders)).then(function(resultsByBuilder) { return results.fetchResultsByBuilder(Object.keys(config.builders)).then(function(resultsByBuilder) {
...@@ -186,13 +159,4 @@ model.analyzeUnexpectedFailures = function(failureCallback) ...@@ -186,13 +159,4 @@ model.analyzeUnexpectedFailures = function(failureCallback)
return Promise.all(failurePromises); return Promise.all(failurePromises);
}; };
model.unexpectedFailureInfoForTestName = function(testName)
{
var resultsByTest = results.unexpectedFailuresByTest(model.state.resultsByBuilder);
return Object.keys(resultsByTest[testName]).map(function(builderName) {
return results.failureInfoForTestAndBuilder(resultsByTest, testName, builderName);
});
};
})(); })();
...@@ -205,16 +205,4 @@ test("buildersInFlightForRevision", 3, function() { ...@@ -205,16 +205,4 @@ test("buildersInFlightForRevision", 3, function() {
model.state.resultsByBuilder = unmock; model.state.resultsByBuilder = unmock;
}); });
test("latestRevisionWithNoBuildersInFlight", 1, function() {
var unmock = model.state.resultsByBuilder;
model.state.resultsByBuilder = {
'Mr. Beasley': { },
'Mr Dixon': {blink_revision: '2'},
'Mr. Sabatini': {blink_revision: '4'},
'Bob': {blink_revision: '6'}
};
equals(model.latestRevisionWithNoBuildersInFlight(), 2);
model.state.resultsByBuilder = unmock;
});
})(); })();
...@@ -60,7 +60,6 @@ var kPreferredSuffixOrder = [ ...@@ -60,7 +60,6 @@ var kPreferredSuffixOrder = [
kCrashLogSuffix, kCrashLogSuffix,
kExpectedAudioSuffix, kExpectedAudioSuffix,
kActualAudioSuffix, kActualAudioSuffix,
// FIXME: Add support for the rest of the result types.
]; ];
// Kinds of results. // Kinds of results.
...@@ -73,7 +72,6 @@ results.kUnknownKind = 'unknown'; ...@@ -73,7 +72,6 @@ results.kUnknownKind = 'unknown';
results.kImageType = 'image'; results.kImageType = 'image';
results.kAudioType = 'audio'; results.kAudioType = 'audio';
results.kTextType = 'text'; results.kTextType = 'text';
// FIXME: There are more types of tests.
function possibleSuffixListFor(failureTypeList) function possibleSuffixListFor(failureTypeList)
{ {
...@@ -142,8 +140,6 @@ function failureTypeList(failureBlob) ...@@ -142,8 +140,6 @@ function failureTypeList(failureBlob)
function resultsDirectoryURL(builderName) function resultsDirectoryURL(builderName)
{ {
if (config.useLocalResults)
return '/localresult?path=';
return config.layoutTestResultsURL + '/' + config.resultsDirectoryNameFromBuilderName(builderName) + '/results/layout-test-results/'; return config.layoutTestResultsURL + '/' + config.resultsDirectoryNameFromBuilderName(builderName) + '/results/layout-test-results/';
} }
...@@ -246,21 +242,6 @@ results.failureInfo = function(testName, builderName, result) ...@@ -246,21 +242,6 @@ results.failureInfo = function(testName, builderName, result)
}; };
} }
results.failureInfoForTestAndBuilder = function(resultsByTest, testName, builderName)
{
return results.failureInfo(testName, builderName, resultsByTest[testName][builderName].actual)
};
results.collectUnexpectedResults = function(dictionaryOfResultNodes)
{
var collectedResults = [];
Object.keys(dictionaryOfResultNodes, function(key, resultNode) {
var analyzer = new results.ResultAnalyzer(resultNode);
collectedResults = collectedResults.concat(analyzer.unexpectedResults());
});
return base.uniquifyArray(collectedResults);
};
// Callback data is [{ buildNumber:, url: }] // Callback data is [{ buildNumber:, url: }]
function historicalResultsLocations(builderName) function historicalResultsLocations(builderName)
{ {
......
...@@ -188,18 +188,6 @@ test("failureInfo", 1, function() { ...@@ -188,18 +188,6 @@ test("failureInfo", 1, function() {
}); });
}); });
test("failureInfoForTestAndBuilder", 1, function() {
var unexpectedFailuresByTest = results.unexpectedFailuresByTest({
"Mock Builder": unittest.kExampleResultsJSON
});
var failureInfo = results.failureInfoForTestAndBuilder(unexpectedFailuresByTest, "userscripts/another-test.html", "Mock Builder");
deepEqual(failureInfo, {
"testName": "userscripts/another-test.html",
"builderName": "Mock Builder",
"failureTypeList": ["TEXT"],
});
});
test("resultKind", 12, function() { test("resultKind", 12, function() {
equals(results.resultKind("http://example.com/foo-actual.txt"), "actual"); equals(results.resultKind("http://example.com/foo-actual.txt"), "actual");
equals(results.resultKind("http://example.com/foo-expected.txt"), "expected"); equals(results.resultKind("http://example.com/foo-expected.txt"), "expected");
...@@ -396,34 +384,6 @@ asyncTest("walkHistory (no revision)", 3, function() { ...@@ -396,34 +384,6 @@ asyncTest("walkHistory (no revision)", 3, function() {
}); });
}); });
test("collectUnexpectedResults", 1, function() {
var dictionaryOfResultNodes = {
"foo": {
"expected": "IMAGE",
"actual": "IMAGE"
},
"bar": {
"expected": "PASS",
"actual": "PASS TEXT"
},
"baz": {
"expected": "TEXT",
"actual": "IMAGE"
},
"qux": {
"expected": "PASS",
"actual": "TEXT"
},
"taco": {
"expected": "PASS",
"actual": "TEXT"
},
};
var collectedResults = results.collectUnexpectedResults(dictionaryOfResultNodes);
deepEqual(collectedResults, ["TEXT", "IMAGE"]);
});
asyncTest("fetchResultsURLs", 5, function() { asyncTest("fetchResultsURLs", 5, function() {
var simulator = new NetworkSimulator(); var simulator = new NetworkSimulator();
......
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
var rollbot = rollbot || {};
(function() {
var rollBotAccount = "blink-deps-roller@chromium.org";
var issueSearchURL = config.kRietveldURL + "/search?" + base.queryParam({
"owner": rollBotAccount,
"closed": 3, // Only open issues.
"with_messages": "true",
"format": "json",
});
var rollSubjectRegexp = /Blink roll (\d+):(\d+)/;
function findRollIssue(results) {
results = results['results'];
for (var i = 0; i < results.length; i++) {
var result = results[i];
if (result['subject'].match(rollSubjectRegexp))
return result;
}
return null;
}
function isRollbotStopped(issue) {
// Ignore the first message as it always contains "STOP"
return issue.messages.slice(1).some(function(message) { return message.text.match(/STOP/); });
}
rollbot.fetchCurrentRoll = function() {
return net.json(issueSearchURL).then(function(searchJSON) {
var issue = findRollIssue(searchJSON);
if (!issue)
return null;
var issueNumber = issue['issue'];
var subjectMatch = issue['subject'].match(rollSubjectRegexp);
return {
'issue': issueNumber,
'url': config.kRietveldURL + "/" + issueNumber,
'isStopped': isRollbotStopped(issue),
'fromRevision': subjectMatch[1],
'toRevision': subjectMatch[2],
};
});
};
// Exposed for unittesting.
rollbot._isRollbotStopped = isRollbotStopped;
})();
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
(function () {
module("rollbot");
var kSearchResults = {
"cursor": "long_string_we_call_cursor",
"results": [
{
"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=",
"cc": [
"chromium-reviews@chromium.org",
],
"reviewers": [
],
"messages": [
{
"sender": "eseidel@chromium.org",
"recipients": [
"eseidel@chromium.org",
"chromium-reviews@chromium.org",
],
"text": "This roll was automatically created by the Blink AutoRollBot (crbug.com\/242461).\nInclude STOP in this message, but should be ignored.",
"disapproval": false,
"date": "2013-06-03 18:14:34.033780",
"approval": false
},
],
"owner_email": "eseidel@chromium.org",
"private": false,
"base_url": "https:\/\/chromium.googlesource.com\/chromium\/src.git@master",
"owner": "eseidel",
"subject": "Blink roll 151668:151677",
"created": "2013-06-03 18:14:28.926040",
"patchsets": [
1
],
"modified": "2013-06-03 18:14:46.869990",
"closed": false,
"commit": true,
"issue": 16337011
},
{
"description": "Add --json-output option to layout_test_wrapper.py\n\nBUG=238381",
"cc": [
"chromium-reviews@chromium.org",
],
"reviewers": [
"iannucci@chromium.org"
],
"messages": [
{
"sender": "eseidel@chromium.org",
"recipients": [
"eseidel@chromium.org",
"chromium-reviews@chromium.org",
],
"text": "I'm not quite sure how to test this code.\n\nI'm also ",
"disapproval": false,
"date": "2013-05-30 23:42:39.309160",
"approval": false
},
]
}
]
};
var kStoppedIssue = {
"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=",
"cc": [
"chromium-reviews@chromium.org",
"none (channel is sheriff)@chromium.org"
],
"reviewers": [
"ilevy@chromium.org"
],
"messages": [
{
"sender": "eseidel@chromium.org",
"recipients": [
"eseidel@chromium.org",
"chromium-reviews@chromium.org",
],
"text": "This string has STOP in it, but should be ignored as the first message.",
"date": "2013-06-09 06:47:35.825820",
},
{
"sender": "commit-bot@chromium.org",
"recipients": [
"eseidel@chromium.org",
"chromium-reviews@chromium.org",
],
"text": "CQ is trying da patch. Follow status at\nhttps:\/\/chromium-status.appspot.com\/cq\/eseidel@chromium.org\/16606004\/1",
"date": "2013-06-09 06:47:45.529170",
},
{
"sender": "ilevy@chromium.org",
"recipients": [
"eseidel@chromium.org",
"ilevy@chromium.org",
"chromium-reviews@chromium.org",
],
"text": "STOP",
"date": "2013-06-09 07:59:48.280360",
},
{
"sender": "eseidel@chromium.org",
"recipients": [
"eseidel@chromium.org",
"ilevy@chromium.org",
"chromium-reviews@chromium.org",
],
"text": "Rollbot was stopped by the presence of \"STOP\" in an earlier comment on this issue.\n",
"date": "2013-06-10 19:35:44.710470",
}
],
"owner_email": "eseidel@chromium.org",
"private": false,
"base_url": "https:\/\/chromium.googlesource.com\/chromium\/src.git@master",
"owner": "eseidel",
"subject": "Blink roll 152079:152080",
"created": "2013-06-09 06:47:31.518010",
"patchsets": [
1
],
"modified": "2013-06-10 19:56:59.618710",
"closed": true,
"commit": false,
"issue": 16606004
};
asyncTest("fetchCurrentRoll", 6, function() {
var simulator = new NetworkSimulator();
simulator.json = function(url)
{
return Promise.resolve(kSearchResults);
};
simulator.runTest(function() {
rollbot.fetchCurrentRoll().then(function(roll) {
equals(roll.issue, 16337011);
equals(roll.url, "https://codereview.chromium.org/16337011");
equals(roll.isStopped, false);
equals(roll.fromRevision, "151668");
equals(roll.toRevision, "151677");
});
}).then(start);
});
test("_isRollbotStopped", 1, function() {
equals(true, rollbot._isRollbotStopped(kStoppedIssue));
});
})();
...@@ -27,6 +27,7 @@ var treestatus = treestatus || {}; ...@@ -27,6 +27,7 @@ var treestatus = treestatus || {};
(function() { (function() {
// FIXME: Turn this into a model-object class.
treestatus.urlByName = function(name) { treestatus.urlByName = function(name) {
if (name == 'blink') if (name == 'blink')
return "http://blink-status.appspot.com/current?format=json"; return "http://blink-status.appspot.com/current?format=json";
......
...@@ -11,7 +11,6 @@ found in the LICENSE file. ...@@ -11,7 +11,6 @@ found in the LICENSE file.
<script src="../scripts/model.js"></script> <script src="../scripts/model.js"></script>
<script src="../scripts/net.js"></script> <script src="../scripts/net.js"></script>
<script src="../scripts/results.js"></script> <script src="../scripts/results.js"></script>
<script src="../scripts/rollbot.js"></script>
<script src="../scripts/svn-log.js"></script> <script src="../scripts/svn-log.js"></script>
<script src="../scripts/treestatus.js"></script> <script src="../scripts/treestatus.js"></script>
<script src="../scripts/ui.js"></script> <script src="../scripts/ui.js"></script>
......
...@@ -36,7 +36,7 @@ found in the LICENSE file. ...@@ -36,7 +36,7 @@ found in the LICENSE file.
Polymer({ Polymer({
attached: function() { attached: function() {
this.update(); this.update();
setInterval(this.update.bind(this), config.kTreeStatusUpdateFrequency); setInterval(this.update.bind(this), config.kUpdateFrequency);
}, },
update: function() { update: function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment