Skip to content

Commit

Permalink
feat: update wave test runner to current version
Browse files Browse the repository at this point in the history
  • Loading branch information
FritzHeiden committed May 27, 2024
1 parent dba739b commit ef87233
Show file tree
Hide file tree
Showing 50 changed files with 3,478 additions and 421 deletions.
7 changes: 4 additions & 3 deletions tools/wave/configuration_loader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# mypy: allow-untyped-defs

from __future__ import absolute_import
from __future__ import unicode_literals
import json
import os
from io import open

from tools.wpt import wpt

Expand Down Expand Up @@ -91,7 +92,7 @@ def load_configuration_file(path):
return {}

configuration = None
with open(path) as configuration_file:
with open(path, "r") as configuration_file:
configuration_file_content = configuration_file.read()
configuration = json.loads(configuration_file_content)
return configuration
4 changes: 1 addition & 3 deletions tools/wave/data/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# mypy: allow-untyped-defs

class Client:
class Client(object):
def __init__(self, session_token):
self.session_token = session_token

Expand Down
4 changes: 1 addition & 3 deletions tools/wave/data/device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# mypy: allow-untyped-defs

class Device:
class Device(object):
def __init__(self, token, user_agent, name, last_active):
self.token = token
self.user_agent = user_agent
Expand Down
6 changes: 2 additions & 4 deletions tools/wave/data/event_listener.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# mypy: allow-untyped-defs

class EventListener:
class EventListener(object):
def __init__(self, dispatcher_token):
super().__init__()
super(EventListener, self).__init__()
self.dispatcher_token = dispatcher_token
self.token = None

Expand Down
4 changes: 1 addition & 3 deletions tools/wave/data/http_polling_client.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# mypy: allow-untyped-defs

from .client import Client


class HttpPollingClient(Client):
def __init__(self, session_token, event):
super().__init__(session_token)
super(HttpPollingClient, self).__init__(session_token)
self.event = event

def send_message(self, message):
Expand Down
4 changes: 1 addition & 3 deletions tools/wave/data/http_polling_event_listener.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# mypy: allow-untyped-defs

from .event_listener import EventListener

class HttpPollingEventListener(EventListener):
def __init__(self, dispatcher_token, event):
super().__init__(dispatcher_token)
super(HttpPollingEventListener, self).__init__(dispatcher_token)
self.event = event
self.message = None

Expand Down
11 changes: 6 additions & 5 deletions tools/wave/data/session.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mypy: allow-untyped-defs

from __future__ import absolute_import
from __future__ import unicode_literals
from ..testing.test_loader import MANUAL, AUTOMATIC

PAUSED = "paused"
Expand All @@ -9,8 +9,11 @@
PENDING = "pending"
UNKNOWN = "unknown"

WMAS = "wmas"
DPCTF = "dpctf"


class Session:
class Session(object):
def __init__(
self,
token=None,
Expand All @@ -32,7 +35,6 @@ def __init__(
reference_tokens=None,
browser=None,
expiration_date=None,
type=None,
malfunctioning_tests=None
):
if token is None:
Expand Down Expand Up @@ -72,7 +74,6 @@ def __init__(
self.reference_tokens = reference_tokens
self.browser = browser
self.expiration_date = expiration_date
self.type = type
if malfunctioning_tests is None:
malfunctioning_tests = []
self.malfunctioning_tests = malfunctioning_tests
51 changes: 51 additions & 0 deletions tools/wave/ecmascript/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# WMAS2017 ECMA Integration

## Generating Tests

Clone the ECMAScript 5 tests into the working directory

```
$ git clone [email protected]:tc39/test262.git -b es5-tests
```

Working directory should look like this

```
generate-tests.js
test262
test-template.html
webplatform-adapter.js
```

Generate the tests by running

```
$ node generate-tests.js
```

Generated tests are placed in `ecmascript` directory. Copy this
directory into the top level directory of the Web Platform Tests
hierarchy in order for the Web Platform Test Runner to run them.

## Test generation parameters

```
$ node generate-tests.js < test262-repo-dir > < output-dir >
```

You can specify where the test262 repository is located and where the
generated tests should be put in by passing the paths to the
generator script as shown above.

## Excluded tests

The following tests are automatically excluded, because they are
causing the browser to freeze.

```
ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js
ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js
ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js
ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-14.js
ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-3-14.js
```
Loading

0 comments on commit ef87233

Please sign in to comment.