diff --git a/testing/web-platform/tests/tools/manifest/manifest.py b/testing/web-platform/tests/tools/manifest/manifest.py index b510006b757e..8bbabc38a445 100644 --- a/testing/web-platform/tests/tools/manifest/manifest.py +++ b/testing/web-platform/tests/tools/manifest/manifest.py @@ -51,6 +51,15 @@ class Manifest(object): for test in type_tests.get(path, set()): yield test + def iterdir(self, dir_name): + if not dir_name.endswith(os.path.sep): + dir_name = dir_name + os.path.sep + for type_tests in self._data.values(): + for path, tests in type_tests.iteritems(): + if path.startswith(dir_name): + for test in tests: + yield test + @property def reftest_nodes_by_url(self): if self._reftest_nodes_by_url is None: diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/manifestinclude.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/manifestinclude.py index f7229d504f13..18d034e34ae3 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/manifestinclude.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/manifestinclude.py @@ -93,7 +93,8 @@ class IncludeManifest(ManifestItem): for manifest, data in test_manifests.iteritems(): found = False rel_path = os.path.relpath(path, data["tests_path"]) - for test in manifest.iterpath(rel_path): + iterator = manifest.iterpath if os.path.isfile(path) else manifest.iterdir + for test in iterator(rel_path): if not hasattr(test, "url"): continue url = test.url