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

Unified Diff: Tools/GardeningServer/ui/test/ct-test-list-tests.html

Issue 464163002: Sheriff-o-Matic: Convert some more ui tests to mocha (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/test/ct-test-list-tests.html
diff --git a/Tools/GardeningServer/ui/ct-test-list-tests.html b/Tools/GardeningServer/ui/test/ct-test-list-tests.html
similarity index 31%
rename from Tools/GardeningServer/ui/ct-test-list-tests.html
rename to Tools/GardeningServer/ui/test/ct-test-list-tests.html
index f0d0a7443f5286da911015080cb21db246d0c651..d470326375d69acb53fe74de359702307cea4f38 100644
--- a/Tools/GardeningServer/ui/ct-test-list-tests.html
+++ b/Tools/GardeningServer/ui/test/ct-test-list-tests.html
@@ -4,80 +4,75 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
-<link rel="import" href="../model/ct-failure.html">
-<link rel="import" href="ct-test-list.html">
+<link rel="import" href="../ct-test-list.html">
-<link rel="import" href="../model/ct-failure.html">
+<link rel="import" href="../../model/ct-failure.html">
<script>
(function () {
+var assert = chai.assert;
+
var kExampleTests = [
- new CTFailure("foo_step", "plugins/gesture-events-scrolled.html", {}, 177164, 177165);
ojan 2014/08/13 00:30:28 :(
- new CTFailure("foo_step", "plugins/transformed-events.html", {}, 177164, 177165);
- new CTFailure("foo_step", "plugins/gesture-events.html", {}, 177164, 177165);
+ new CTFailure("foo_step", "plugins/gesture-events-scrolled.html", {}, 177164, 177165),
+ new CTFailure("foo_step", "plugins/transformed-events.html", {}, 177164, 177165),
+ new CTFailure("foo_step", "plugins/gesture-events.html", {}, 177164, 177165),
];
var kExampleTestsChromium = [
- new CTFailure("browser_tests", "SomeTest.SubTest1", {}, 177164, 177165);
- new CTFailure("browser_tests", "SomeTest.SubTest2", {}, 177164, 177165);
+ new CTFailure("browser_tests", "SomeTest.SubTest1", {}, 177164, 177165),
+ new CTFailure("browser_tests", "SomeTest.SubTest2", {}, 177164, 177165),
];
var kExampleTestsBlink = [
- new CTFailure("webkit_tests", "fast/events/foo.html", {}, 177164, 177165);
- new CTFailure("webkit_tests", "fast/events/bar.html", {}, 177164, 177165);
+ new CTFailure("webkit_tests", "fast/events/foo.html", {}, 177164, 177165),
+ new CTFailure("webkit_tests", "fast/events/bar.html", {}, 177164, 177165),
];
-module("ct-test-list");
-
-asyncTest("basic", 4, function() {
+function createTestList(tests, tree) {
var list = document.createElement('ct-test-list');
-
- list.tests = kExampleFailures;
+ list.tests = tests;
list.tree = 'blink';
-
- setTimeout(function() {
- var tests = list.shadowRoot.querySelectorAll('a');
- equal(tests.length, 3);
- equal(tests[0].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events-scrolled.html&testType=foo_step');
- equal(tests[1].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Ftransformed-events.html&testType=foo_step');
- equal(tests[2].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events.html&testType=foo_step');
-
- start();
- });
-});
-
-asyncTest("groupingChromium", 2, function() {
- var list = document.createElement('ct-test-list');
-
- list.tests = kExampleTestsChromium;
- list.tree = 'chromium';
-
- setTimeout(function() {
- var tests = list.shadowRoot.querySelectorAll('a');
- equal(tests.length, 0);
- var icons = list.shadowRoot.querySelectorAll('paper-icon-button');
- equal(icons.length, 1);
-
- start();
+ return list;
+}
+
+describe('ct-test-list', function() {
+ var list;
+
+ describe('tests failed', function() {
+ before(function(done) {
+ list = createTestList(kExampleTests, 'blink');
+ setTimeout(done);
+ });
+
+ it('should show all tests', function() {
+ var tests = list.shadowRoot.querySelectorAll('a');
+ assert.equal(tests.length, 3);
+ assert.equal(tests[0].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events-scrolled.html&testType=foo_step');
+ assert.equal(tests[1].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Ftransformed-events.html&testType=foo_step');
+ assert.equal(tests[2].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events.html&testType=foo_step');
+ });
});
-});
-
-asyncTest("groupingBlink", 2, function() {
- var list = document.createElement('ct-test-list');
-
- list.tests = kExampleTestsBlink;
- list.tree = 'blink';
-
- setTimeout(function() {
- var tests = list.shadowRoot.querySelectorAll('a');
- equal(tests.length, 0);
- var icons = list.shadowRoot.querySelectorAll('paper-icon-button');
- equal(icons.length, 1);
- start();
+ describe('group of tests failed', function() {
+ afterEach(function() {
+ var tests = list.shadowRoot.querySelectorAll('a');
+ assert.lengthOf(tests, 0);
+ var icons = list.shadowRoot.querySelectorAll('paper-icon-button');
+ assert.lengthOf(icons, 1);
+ });
+
+ it('should group chromium tests', function(done) {
+ list = createTestList(kExampleTestsChromium, 'chromium');
+ setTimeout(done);
+ });
+
+ it('should group blink tests', function(done) {
+ list = createTestList(kExampleTestsBlink, 'blink');
+ setTimeout(done);
+ });
});
});
-})()
+})();
</script>

Powered by Google App Engine
This is Rietveld 408576698