Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Apr 17, 2018
1 parent 2aa0ef3 commit deef861
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tools/lint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ def check_python_ast(repo_root, path, f):
broken_python_metadata = re.compile(b"#\s*META:")


def check_script_metadata(repo_root, path, f, css_mode):
if path.endswith(".any.js"):
def check_script_metadata(repo_root, path, f):
if path.endswith((".worker.js", ".any.js")):
meta_re = js_meta_re
broken_metadata = broken_js_metadata
elif path.endswith(".py"):
Expand Down
21 changes: 17 additions & 4 deletions tools/manifest/sourcefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ def name_is_any(self):
be a multi-global js test file"""
return "any" in self.meta_flags and self.ext == ".js"

@property
def name_is_worker(self):
"""Check if the file name matches the conditions for the file to
be a worker js test file"""
return "worker" in self.meta_flags and self.ext == ".js"

@property
def name_is_window(self):
"""Check if the file name matches the conditions for the file to
Expand Down Expand Up @@ -316,7 +322,7 @@ def timeout_nodes(self):

@cached_property
def script_metadata(self):
if self.name_is_any or self.name_is_window:
if self.name_is_worker or self.name_is_any or self.name_is_window:
regexp = js_meta_re
elif self.name_is_webdriver:
regexp = python_meta_re
Expand Down Expand Up @@ -549,11 +555,18 @@ def manifest_items(self):
rv[1].append(TestharnessTest(self, url,
timeout=self.timeout))
break
# XXX
print rv

elif self.name_is_worker:
rv = (TestharnessTest.item_type,
[TestharnessTest(self, replace_end(self.url, ".worker.js", ".worker.html"),
timeout=self.timeout)])

elif self.name_is_window:
rv = TestharnessTest.item_type, [
TestharnessTest(self, replace_end(self.url, ".window.js", ".window.html"),
timeout=self.timeout)]
rv = (TestharnessTest.item_type,
[TestharnessTest(self, replace_end(self.url, ".window.js", ".window.html"),
timeout=self.timeout)])

elif self.name_is_webdriver:
rv = WebdriverSpecTest.item_type, [WebdriverSpecTest(self, self.url,
Expand Down

0 comments on commit deef861

Please sign in to comment.