Bug 1509459 - Get the flexbox highlighter state if the highlighter is ready in the...
[gecko.git] / testing / mochitest / chunkifyTests.js
blob21ca0e46597123add7a2c86b41c3876933874630
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 function skipTests(tests, startTestPattern, endTestPattern) {
6   var startIndex = 0, endIndex = tests.length - 1;
7   for (var i = 0; i < tests.length; ++i) {
8     var test_path;
9     if ((tests[i] instanceof Object) && ("test" in tests[i])) {
10       test_path = tests[i].test.url;
11     } else if ((tests[i] instanceof Object) && ("url" in tests[i])) {
12       test_path = tests[i].url;
13     } else {
14       test_path = tests[i];
15     }
16     if (startTestPattern && test_path.endsWith(startTestPattern)) {
17       startIndex = i;
18     }
20     if (endTestPattern && test_path.endsWith(endTestPattern)) {
21       endIndex = i;
22     }
23   }
25   return tests.slice(startIndex, endIndex + 1);