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

Side by Side Diff: Tools/GardeningServer/scripts/builders_unittests.js

Issue 173133003: Convert garden-o-matic guts over to promises where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update to ToT Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Tools/GardeningServer/scripts/builders.js ('k') | Tools/GardeningServer/scripts/checkout.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 return Promise.resolve(failingBuildInfoJSON); 710 return Promise.resolve(failingBuildInfoJSON);
711 else if (/WebKit%20ASAN/.exec(url)) 711 else if (/WebKit%20ASAN/.exec(url))
712 return Promise.resolve(failingBuildInfoJSON); 712 return Promise.resolve(failingBuildInfoJSON);
713 else { 713 else {
714 ok(false, "Unexpected URL: " + url); 714 ok(false, "Unexpected URL: " + url);
715 return Promise.reject("Unexpected URL: " + url); 715 return Promise.reject("Unexpected URL: " + url);
716 }; 716 };
717 }; 717 };
718 718
719 simulator.runTest(function() { 719 simulator.runTest(function() {
720 builders.buildersFailingNonLayoutTests(function(builderNameList) { 720 builders.buildersFailingNonLayoutTests().then(function(builderNameList) {
721 deepEqual(builderNameList, { 721 deepEqual(builderNameList, {
722 "WebKit Linux": [ 722 "WebKit Linux": [
723 "webkit_gpu_tests" 723 "webkit_gpu_tests"
724 ], 724 ],
725 "WebKit Mac10.6": [ 725 "WebKit Mac10.6": [
726 "webkit_gpu_tests" 726 "webkit_gpu_tests"
727 ], 727 ],
728 "WebKit ASAN": [ 728 "WebKit ASAN": [
729 "webkit_gpu_tests" 729 "webkit_gpu_tests"
730 ], 730 ],
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 return Promise.resolve(failingBuildInfoJSON); 764 return Promise.resolve(failingBuildInfoJSON);
765 else if (/WebKit%20ASAN/.exec(url)) 765 else if (/WebKit%20ASAN/.exec(url))
766 return Promise.resolve(failingBuildInfoJSON); 766 return Promise.resolve(failingBuildInfoJSON);
767 else { 767 else {
768 ok(false, "Unexpected URL: " + url); 768 ok(false, "Unexpected URL: " + url);
769 return Promise.reject("Unexpected URL: " + url); 769 return Promise.reject("Unexpected URL: " + url);
770 } 770 }
771 }; 771 };
772 772
773 simulator.runTest(function() { 773 simulator.runTest(function() {
774 builders.buildersFailingNonLayoutTests(function(builderNameList) { 774 builders.buildersFailingNonLayoutTests().then(function(builderNameList) {
775 deepEqual(builderNameList, { 775 deepEqual(builderNameList, {
776 "WebKit Linux": [ 776 "WebKit Linux": [
777 "webkit_tests", 777 "webkit_tests",
778 "archive_webkit_tests_results", 778 "archive_webkit_tests_results",
779 "webkit_gpu_tests", 779 "webkit_gpu_tests",
780 "archive_webkit_tests_gpu_results" 780 "archive_webkit_tests_gpu_results"
781 ], 781 ],
782 "WebKit ASAN": [ 782 "WebKit ASAN": [
783 "webkit_tests", 783 "webkit_tests",
784 "archive_webkit_tests_results", 784 "archive_webkit_tests_results",
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 return Promise.resolve(failingBuildInfoJSON); 820 return Promise.resolve(failingBuildInfoJSON);
821 else if (/WebKit%20ASAN/.exec(url)) 821 else if (/WebKit%20ASAN/.exec(url))
822 return Promise.resolve(failingBuildInfoJSON); 822 return Promise.resolve(failingBuildInfoJSON);
823 else { 823 else {
824 ok(false, "Unexpected URL: " + url); 824 ok(false, "Unexpected URL: " + url);
825 return Promise.reject("Unexpected URL: " + url); 825 return Promise.reject("Unexpected URL: " + url);
826 } 826 }
827 }; 827 };
828 828
829 simulator.runTest(function() { 829 simulator.runTest(function() {
830 builders.buildersFailingNonLayoutTests(function(builderNameList) { 830 builders.buildersFailingNonLayoutTests().then(function(builderNameList) {
831 deepEqual(builderNameList, {}); 831 deepEqual(builderNameList, {});
832 }); 832 });
833 }).then(function() { 833 }).then(function() {
834 834
835 deepEqual(requestedURLs, [ 835 deepEqual(requestedURLs, [
836 "http://build.chromium.org/p/chromium.webkit/json/builders", 836 "http://build.chromium.org/p/chromium.webkit/json/builders",
837 "http://build.chromium.org/p/chromium.webkit/json/builders/WebKit%20 Linux/builds/21460", 837 "http://build.chromium.org/p/chromium.webkit/json/builders/WebKit%20 Linux/builds/21460",
838 "http://build.chromium.org/p/chromium.webkit/json/builders/WebKit%20 ASAN/builds/11460", 838 "http://build.chromium.org/p/chromium.webkit/json/builders/WebKit%20 ASAN/builds/11460",
839 ]); 839 ]);
840 start(); 840 start();
841 }); 841 });
842 }); 842 });
843 843
844 })(); 844 })();
OLDNEW
« no previous file with comments | « Tools/GardeningServer/scripts/builders.js ('k') | Tools/GardeningServer/scripts/checkout.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698