Closed Bug 1873153 Opened 5 months ago Closed 5 months ago

JavascriptException: SyntaxError: unexpected token: identifier (in "testharness_webdriver_resume.js")

Categories

(Testing :: web-platform-tests, defect)

defect

Tracking

(firefox123 fixed)

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: whimboo, Assigned: jgraham)

Details

Attachments

(1 file)

This error can be seen when running tests which use URLs that have quotes included, like:

mach wpt --setpref="remote.log.truncate=false" --setpref="remote.log.level=Trace" "testing/web-platform/tests/attribution-reporting/request-format.sub.https.html"

The code that gets executed here is in executors/testharness_webdriver_resume.js and here we fail with passing in the URL correctly:

 0:16.90 pid:44002 1704443197730	Marionette	DEBUG	2 -> [0,97,"WebDriver:ExecuteAsyncScript",{"script":"// We have to set the url here to ensure we get the same escaping as in the harness\n// and also to handle the case where the test changes the fragment\nwindow.__wptrunner_url = \"/attribution-reporting/request-format.sub.https.html?method=xhr&eligible={\"eventSourceEligible\":true,\"triggerEligible\":false}&expected-eligible=event-source\";\nwindow.__wptrunner_testdriver_callback = arguments[arguments.length - 1];\nwindow.__wptrunner_process_next_event();","args":[],"newSandbox":false,"sandbox":null,"scriptTimeout":null,"line":93,"filename":"testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py"}]
 0:16.90 pid:44002 1704443197730	Marionette	TRACE	[18] MarionetteCommands actor created for window id 8589934618
 0:16.90 pid:44002 1704443197732	Marionette	DEBUG	2 <- [1,97,{"error":"javascript error","message":"SyntaxError: unexpected token: identifier","stacktrace":""},null]
 0:16.90 WARNING Traceback (most recent call last):
  File "/Users/henrik/code/gecko/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py", line 878, in run_func
    self.result = True, self.func(self.protocol, self.url, self.timeout)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/henrik/code/gecko/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py", line 1001, in do_testharness
    result = protocol.base.execute_script(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/henrik/code/gecko/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py", line 93, in execute_script
    return method(script, new_sandbox=False, sandbox=None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/henrik/code/gecko/testing/marionette/client/marionette_driver/marionette.py", line 1925, in execute_async_script
    rv = self._send_message("WebDriver:ExecuteAsyncScript", body, key="value")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/henrik/code/gecko/testing/marionette/client/marionette_driver/decorators.py", line 24, in _
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/henrik/code/gecko/testing/marionette/client/marionette_driver/marionette.py", line 776, in _send_message
    self._handle_error(err)
  File "/Users/henrik/code/gecko/testing/marionette/client/marionette_driver/marionette.py", line 788, in _handle_error
    raise errors.lookup(error)(message, stacktrace=stacktrace)
marionette_driver.errors.JavascriptException: SyntaxError: unexpected token: identifier

The solution would be the following change:

-window.__wptrunner_url = "%(url)s";
+window.__wptrunner_url = '%(url)s';

James, this might affect a lot of tests in our tree that currently fail due to this issue. So I expect quite a good number of meta data updates for now passing tests. Can you please check that?

Flags: needinfo?(james)
Summary: JavascriptException: SyntaxError: unexpected token: identifier → JavascriptException: SyntaxError: unexpected token: identifier (in "testharness_webdriver_resume.js")
Assignee: nobody → james
Status: NEW → ASSIGNED
Flags: needinfo?(james)
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/187c82b48499
Pass URL as an argument to testharness_webdriver_resume, r=whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43921 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: