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

Unified Diff: Tools/GardeningServer/scripts/model_unittests.js

Issue 402603007: Get sheriff-o-matic data from auto-sheriff.appspot.com. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update and delete old code Created 6 years, 5 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/scripts/model_unittests.js
diff --git a/Tools/GardeningServer/scripts/model_unittests.js b/Tools/GardeningServer/scripts/model_unittests.js
deleted file mode 100644
index 467ce5b92886906776d64653602ce3a6f92bb61c..0000000000000000000000000000000000000000
--- a/Tools/GardeningServer/scripts/model_unittests.js
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (C) 2011 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("model");
-
-var kExampleCommitDataXML =
- "<feed xmlns='http://www.w3.org/2005/Atom'>\n" +
- "<title>blink, branch master</title>\n" +
- "<subtitle>Mirror of the Chromium Blink repository.</subtitle>\n" +
- "<link rel='alternate' type='text/html' href='http://blink.lc/blink/'/>\n" +
- "<entry>\n" +
- "<title>Throw SecurityError when setting 'Replaceable' properties cross-origin.</title>\n" +
- "<updated>2013-09-30T20:22:01Z</updated>\n" +
- "<author>\n" +
- "<name>mkwst@chromium.org</name>\n" +
- "</author>\n" +
- "<published>2013-09-30T20:22:01Z</published>\n" +
- "<link rel='alternate' type='text/html' href='http://blink.lc/blink/commit/?id=723e62a4a4e093435b4772b4839aa3fd7cf6b991'/>\n" +
- "<id>723e62a4a4e093435b4772b4839aa3fd7cf6b991</id>\n" +
- "<content type='text'>\n" +
- "This matches Gecko's behavior for these types of properties.\n" +
- "\n" +
- "BUG=13\n" +
- "R=jochen@chromium.org\n" +
- "CC=abarth@chromium.org\n" +
- "\n" +
- "Review URL: https://chromiumcodereview.appspot.com/25022002\n" +
- "\n" +
- "git-svn-id: svn://svn.chromium.org/blink/trunk@3 bbb929c8-8fbe-4397-9dbb-9b2b20218538\n" +
- "</content>\n" +
- "</entry>\n" +
- "<entry>\n" +
- "<title>Fix one more layering violation caught by check-blink-deps</title>\n" +
- "<updated>2013-09-30T19:36:21Z</updated>\n" +
- "<author>\n" +
- "<name>eseidel@chromium.org</name>\n" +
- "</author>\n" +
- "<published>2013-09-30T19:36:21Z</published>\n" +
- "<link rel='alternate' type='text/html' href='http://blink.lc/blink/commit/?id=51e5c70050dcb0980eb31f112d0cd948f3ece820'/>\n" +
- "<id>51e5c70050dcb0980eb31f112d0cd948f3ece820</id>\n" +
- "<content type='text'>\n" +
- "core/platform may not depend on core/ even for testing.\n" +
- "\n" +
- "BUG=12\n" +
- "R=abarth@chromium.org, abarth\n" +
- "\n" +
- "Review URL: https://codereview.chromium.org/25284004\n" +
- "\n" +
- "git-svn-id: svn://svn.chromium.org/blink/trunk@2 bbb929c8-8fbe-4397-9dbb-9b2b20218538\n" +
- "</content>\n" +
- "</entry>\n" +
- "<entry>\n" +
- "<title>Update DEPS include_rules after addition of root-level platform directory</title>\n" +
- "<updated>2013-09-30T19:28:49Z</updated>\n" +
- "<author>\n" +
- "<name>eseidel@chromium.org</name>\n" +
- "</author>\n" +
- "<published>2013-09-30T19:28:49Z</published>\n" +
- "<link rel='alternate' type='text/html' href='http://blink.lc/blink/commit/?id=227add0156e8ab272abcd3368dfc0b5a91f35749'/>\n" +
- "<id>227add0156e8ab272abcd3368dfc0b5a91f35749</id>\n" +
- "<content type='text'>\n" +
- "These were all failures noticed when running check-blink-deps\n" +
- "\n" +
- "R=abarth@chromium.org, abarth\n" +
- "BUG=11\n" +
- "\n" +
- "Review URL: https://codereview.chromium.org/25275005\n" +
- "\n" +
- "git-svn-id: svn://svn.chromium.org/blink/trunk@1 bbb929c8-8fbe-4397-9dbb-9b2b20218538\n" +
- "</content>\n" +
- "</entry>\n" +
- "</feed>\n";
-
-asyncTest("updateRecentCommits", 2, function() {
- var simulator = new NetworkSimulator();
-
- simulator.xml = function(url)
- {
- var parser = new DOMParser();
- var responseDOM = parser.parseFromString(kExampleCommitDataXML, "application/xml");
- return Promise.resolve(responseDOM);
- };
-
- simulator.runTest(function() {
- model.updateRecentCommits().then(function() {
- var recentCommits = model.state.recentCommits;
- delete model.state.recentCommits;
- recentCommits.forEach(function(commitData) {
- delete commitData.message;
- });
- deepEqual(recentCommits, [{
- "revision": 3,
- "title": "Throw SecurityError when setting 'Replaceable' properties cross-origin.",
- "time": "2013-09-30T20:22:01Z",
- "summary": "This matches Gecko's behavior for these types of properties.",
- "author": "mkwst@chromium.org",
- "reviewer": "jochen@chromium.org",
- "bugID": [13],
- "revertedRevision": undefined,
- },
- {
- "revision": 2,
- "title": "Fix one more layering violation caught by check-blink-deps",
- "time": "2013-09-30T19:36:21Z",
- "summary": "core/platform may not depend on core/ even for testing.",
- "author": "eseidel@chromium.org",
- "reviewer": "abarth@chromium.org, abarth",
- "bugID": [12],
- "revertedRevision": undefined
- },
- {
- "revision": 1,
- "title": "Update DEPS include_rules after addition of root-level platform directory",
- "time": "2013-09-30T19:28:49Z",
- "summary": "These were all failures noticed when running check-blink-deps",
- "author": "eseidel@chromium.org",
- "reviewer": "abarth@chromium.org, abarth",
- "bugID": [11],
- "revertedRevision": undefined
- }
- ]);
- });
- }).then(start);
-});
-
-asyncTest("commitDataListForRevisionRange", 6, function() {
- var simulator = new NetworkSimulator();
-
- simulator.xml = function(url)
- {
- var parser = new DOMParser();
- var responseDOM = parser.parseFromString(kExampleCommitDataXML, "application/xml");
- return Promise.resolve(responseDOM);
- };
-
- simulator.runTest(function() {
- model.updateRecentCommits().then(function() {
- function extractBugIDs(commitData)
- {
- return commitData.bugID;
- }
-
- deepEqual(model.commitDataListForRevisionRange(3, 3).map(extractBugIDs), [[13]]);
- deepEqual(model.commitDataListForRevisionRange(1, 3).map(extractBugIDs), [[11], [12], [13]]);
- deepEqual(model.commitDataListForRevisionRange(0, 1).map(extractBugIDs), [[11]]);
- deepEqual(model.commitDataListForRevisionRange(0, 4).map(extractBugIDs), [[11], [12], [13]]);
- deepEqual(model.commitDataListForRevisionRange(4, 0).map(extractBugIDs), []);
- delete model.state.recentCommits;
- });
- }).then(start);
-});
-
-test("buildersInFlightForRevision", 3, function() {
- var unmock = model.state.resultsByBuilder;
- model.state.resultsByBuilder = {
- 'Mr. Beasley': {blink_revision: '5'},
- 'Mr Dixon': {blink_revision: '1'},
- 'Mr. Sabatini': {blink_revision: '4'},
- 'Bob': {blink_revision: '6'}
- };
- deepEqual(model.buildersInFlightForRevision(1), {});
- deepEqual(model.buildersInFlightForRevision(3), {
- "Mr Dixon": {
- "actual": "BUILDING"
- }
- });
- deepEqual(model.buildersInFlightForRevision(10), {
- "Mr. Beasley": {
- "actual": "BUILDING"
- },
- "Mr Dixon": {
- "actual": "BUILDING"
- },
- "Mr. Sabatini": {
- "actual": "BUILDING"
- },
- "Bob": {
- "actual": "BUILDING"
- }
- });
- model.state.resultsByBuilder = unmock;
-});
-
-})();

Powered by Google App Engine
This is Rietveld 408576698