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

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

Issue 400423002: Remove base.* methods. (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/results.js ('k') | Tools/GardeningServer/scripts/svn-log.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/scripts/results_unittests.js
diff --git a/Tools/GardeningServer/scripts/results_unittests.js b/Tools/GardeningServer/scripts/results_unittests.js
index 4c32559a43dd2310a8776c09ebd7c71b3e6dff38..f0dca047bac0138a0384625bdfd3392e0f16a317 100644
--- a/Tools/GardeningServer/scripts/results_unittests.js
+++ b/Tools/GardeningServer/scripts/results_unittests.js
@@ -153,6 +153,72 @@ test("ResultAnalyzer", 44, function() {
ok(!analyzer.flaky());
});
+test("trimExtension", 6, function() {
+ equals(results._trimExtension("xyz"), "xyz");
+ equals(results._trimExtension("xy.z"), "xy");
+ equals(results._trimExtension("x.yz"), "x");
+ equals(results._trimExtension("x.y.z"), "x.y");
+ equals(results._trimExtension(".xyz"), "");
+ equals(results._trimExtension(""), "");
+});
+
+test("joinPath", 1, function() {
+ var value = results._joinPath("path/to", "test.html");
+ equals(value, "path/to/test.html");
+});
+
+test("joinPath with empty parent", 1, function() {
+ var value = results._joinPath("", "test.html");
+ equals(value, "test.html");
+});
+
+test("filterTree", 2, function() {
+ var tree = {
+ 'path': {
+ 'to': {
+ 'test.html': {
+ 'actual': 'PASS',
+ 'expected': 'FAIL'
+ }
+ },
+ 'another.html': {
+ 'actual': 'TEXT',
+ 'expected': 'PASS'
+ }
+ }
+ }
+
+ function isLeaf(node)
+ {
+ return !!node.actual;
+ }
+
+ function actualIsText(node)
+ {
+ return node.actual == 'TEXT';
+ }
+
+ var all = results._filterTree(tree, isLeaf, function() { return true });
+ deepEqual(all, {
+ 'path/to/test.html': {
+ 'actual': 'PASS',
+ 'expected': 'FAIL'
+ },
+ 'path/another.html': {
+ 'actual': 'TEXT',
+ 'expected': 'PASS'
+ }
+ });
+
+ var text = results._filterTree(tree, isLeaf, actualIsText);
+ deepEqual(text, {
+ 'path/another.html': {
+ 'actual': 'TEXT',
+ 'expected': 'PASS'
+ }
+ });
+});
+
test("unexpectedFailures", 1, function() {
var unexpectedFailures = results.unexpectedFailures(unittest.kExampleResultsJSON);
deepEqual(unexpectedFailures, {
@@ -391,7 +457,7 @@ asyncTest("fetchResultsURLs", 5, function() {
simulator.probe = function(url)
{
probedURLs.push(url);
- if (base.endsWith(url, '.txt'))
+ if (url.endsWith('.txt'))
return Promise.resolve();
else if (/taco.+png$/.test(url))
return Promise.resolve();
@@ -454,7 +520,7 @@ asyncTest("fetchResultsByBuilder", 3, function() {
simulator.jsonp = function(url)
{
probedURLs.push(url);
- return Promise.resolve(base.endsWith(url, 'results/layout-test-results/failing_results.json'));
+ return Promise.resolve(url.endsWith('results/layout-test-results/failing_results.json'));
};
simulator.runTest(function() {
« no previous file with comments | « Tools/GardeningServer/scripts/results.js ('k') | Tools/GardeningServer/scripts/svn-log.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698