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

Unified Diff: Tools/GardeningServer/ui/ct-failure-analyzer-tests.html

Issue 462453002: Sheriff-O-Matic: Transition more unit tests to mocha. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase and fix Created 6 years, 4 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/ui/ct-failure-analyzer-tests.html
diff --git a/Tools/GardeningServer/ui/ct-failure-analyzer-tests.html b/Tools/GardeningServer/ui/ct-failure-analyzer-tests.html
deleted file mode 100644
index 7b47a094c7750b28392ca0f3b8c296b652283ff5..0000000000000000000000000000000000000000
--- a/Tools/GardeningServer/ui/ct-failure-analyzer-tests.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!--
-Copyright 2014 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-
-<link rel="import" href="ct-failure-analyzer.html">
-
-<script>
-(function() {
-
-module("ct-failure-analyzer");
-
-test("_failureComparator", 1, function() {
- var analyzer = document.createElement('ct-failure-analyzer');
-
- var resultsByBuilder = {};
- var failure1 = new CTFailure("step1", "reason1", resultsByBuilder, 123, 123);
- var failure2 = new CTFailure("step1", "reason2", resultsByBuilder, 123, 123);
- var failure3 = new CTFailure("step1", "reason3", resultsByBuilder, 123, 123);
- var failure4 = new CTFailure("step2", "reason1", resultsByBuilder, 123, 123);
-
- var failures = [failure4, failure3, failure2, failure1];
- var expectedFailures = [failure1, failure2, failure3, failure4];
- deepEqual(failures.sort(analyzer._failureComparator), expectedFailures);
-});
-
-test("_failureListComparator", 8, function() {
- var analyzer = document.createElement('ct-failure-analyzer');
-
- var revision1 = {
- 'chromium': 1,
- 'blink': 2
- };
- var revision2 = {
- 'chromium': 2,
- 'blink': 1
- };
- var revision3 = {
- 'chromium': 2,
- 'blink': 2
- };
- var resultsByBuilder = {};
- var failure1 = new CTFailure("step", "reason", resultsByBuilder, revision1, revision1);
- var failure2 = new CTFailure("step", "reason", resultsByBuilder, revision2, revision2);
- var failure3 = new CTFailure("step", "reason", resultsByBuilder, revision3, revision3);
- var failure4 = new CTFailure("step", "reason", resultsByBuilder, null, null);
-
- // Sort by last revision first.
- ok(analyzer._failureListComparator('chromium', [failure1], [failure2]) > 0);
- ok(analyzer._failureListComparator('chromium', [failure2], [failure1]) < 0);
- ok(analyzer._failureListComparator('chromium', [failure1], [failure1]) == 0);
-
- // If the tree revisions are equal, take others.
- ok(analyzer._failureListComparator('chromium', [failure2], [failure3]) > 0);
-
- // Prioritize the given tree.
- ok(analyzer._failureListComparator('chromium', [failure1], [failure2]) > 0);
- ok(analyzer._failureListComparator('blink', [failure1], [failure2]) < 0);
-
- // Default to 'chromium'.
- ok(analyzer._failureListComparator(undefined, [failure1], [failure2]) > 0);
-
- // Failures without a revision go to the end.
- ok(analyzer._failureListComparator('chromium', [failure4], [failure1]) < 0);
-});
-
-})()
-</script>

Powered by Google App Engine
This is Rietveld 408576698