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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py

Issue 2686303003: webkitpy: Remove --run-chunk and --run-part. (Closed)
Patch Set: webkitpy: Remove --run-chunk and --run-part. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py
index 25a37cd021a4941b861f1f64c0288567df0267d2..85564d36d7bfe792a96c484ba075729abb3b2ee6 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py
@@ -85,3 +85,36 @@ class LayoutTestFinderTests(unittest.TestCase):
tests = finder.find_tests(fastest_percentile=90, args=[])
self.assertEqual(set(tests[1]), set(['fast/css/1.html']))
+
+ def test_split_chunks(self):
+ split = layout_test_finder.LayoutTestFinder._split_into_chunks # pylint: disable=protected-access
+
+ tests = [1, 2, 3, 4]
+ self.assertEqual(([1, 2, 3, 4], []), split(tests, 0, 1))
+
+ self.assertEqual(([1, 2], [3, 4]), split(tests, 0, 2))
+ self.assertEqual(([3, 4], [1, 2]), split(tests, 1, 2))
+
+ self.assertEqual(([1, 2], [3, 4]), split(tests, 0, 3))
+ self.assertEqual(([3, 4], [1, 2]), split(tests, 1, 3))
+ self.assertEqual(([], [1, 2, 3, 4]), split(tests, 2, 3))
+
+ tests = [1, 2, 3, 4, 5]
+ self.assertEqual(([1, 2, 3, 4, 5], []), split(tests, 0, 1))
+
+ self.assertEqual(([1, 2, 3], [4, 5]), split(tests, 0, 2))
+ self.assertEqual(([4, 5], [1, 2, 3]), split(tests, 1, 2))
+
+ self.assertEqual(([1, 2], [3, 4, 5]), split(tests, 0, 3))
+ self.assertEqual(([3, 4], [1, 2, 5]), split(tests, 1, 3))
+ self.assertEqual(([5], [1, 2, 3, 4]), split(tests, 2, 3))
+
+ tests = [1, 2, 3, 4, 5, 6]
+ self.assertEqual(([1, 2, 3, 4, 5, 6], []), split(tests, 0, 1))
+
+ self.assertEqual(([1, 2, 3], [4, 5, 6]), split(tests, 0, 2))
+ self.assertEqual(([4, 5, 6], [1, 2, 3]), split(tests, 1, 2))
+
+ self.assertEqual(([1, 2], [3, 4, 5, 6]), split(tests, 0, 3))
+ self.assertEqual(([3, 4], [1, 2, 5, 6]), split(tests, 1, 3))
+ self.assertEqual(([5, 6], [1, 2, 3, 4]), split(tests, 2, 3))

Powered by Google App Engine
This is Rietveld 408576698