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

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

Issue 405853002: Delete dead code now that the polymer port of garden-o-matic is done. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Tools/GardeningServer/scripts/base.js ('k') | Tools/GardeningServer/scripts/config.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/scripts/base_unittests.js
diff --git a/Tools/GardeningServer/scripts/base_unittests.js b/Tools/GardeningServer/scripts/base_unittests.js
index 34968d33f816911e3496a267cbb7c6eee705fc1b..f41ffc1cd410498ca2b6ed127dcf53ebec00188f 100644
--- a/Tools/GardeningServer/scripts/base_unittests.js
+++ b/Tools/GardeningServer/scripts/base_unittests.js
@@ -58,12 +58,6 @@ test("joinPath with empty parent", 1, function() {
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() {
deepEqual(base.uniquifyArray([]), []);
deepEqual(base.uniquifyArray(["a"]), ["a"]);
@@ -72,29 +66,6 @@ test("uniquifyArray", 5, function() {
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() {
var tree = {
'path': {
@@ -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() {
var LikeDiv = base.extends("div", {
@@ -296,10 +190,6 @@ test("extends", 14, function() {
document.body.removeChild(document.body.lastChild);
});
-test("getURLParameter", 1, function() {
- ok(!base.getURLParameter('non-existant'));
-});
-
test("parseJSONP", 6, function() {
deepEqual(base.parseJSONP(""), {});
deepEqual(base.parseJSONP('p({"key": "value"})'), {"key": "value"});
« no previous file with comments | « Tools/GardeningServer/scripts/base.js ('k') | Tools/GardeningServer/scripts/config.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698