Skip to content

Commit 581b7e6

Browse files
Uzlopakgithub-actions[bot]
authored andcommitted
chore: update WPT
1 parent 14e62db commit 581b7e6

5 files changed

Lines changed: 171 additions & 56 deletions

File tree

test/fixtures/wpt/fetch/http-cache/no-vary-search.tentative.any.js

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
// META: script=http-cache.js
77
/*
88
NOTE for testing No-Vary-Search-Header:
9-
If `params` is set to true, `expect=("dispatch" "uuid")` must be specified.
10-
Otherwise:
11-
- The same HTTP Cache will be used by other tests, which are supposed
12-
to be distinguished by uuid.
13-
- The test utility cannot get the server's states because UA will use the HTTP
14-
Cache instead of sending a new request to server to ask for the latest state.
9+
- If `params` is set to true, `expect=("dispatch" "uuid")` must be specified.
10+
Otherwise:
11+
- The same HTTP Cache will be used by other tests, which are supposed
12+
to be distinguished by uuid.
13+
- The test utility cannot get the server's states because UA will use the HTTP
14+
Cache instead of sending a new request to server to ask for the latest state.
15+
- Do not test not_cached cases and cached cases within one test. Test infra
16+
checks the number of requests and responses without considering if the
17+
previous responses should be served from cache or not.
1518
*/
1619
var tests = [
1720
{
@@ -28,6 +31,61 @@ var tests = [
2831
expected_type: "cached"
2932
}
3033
]
34+
},
35+
{
36+
name: "Ground truth: When key-order is not set, URLs should be compared in an order-sensitive way.",
37+
requests: [
38+
{
39+
url_params: "a=1&b=2",
40+
response_headers: [
41+
["Cache-Control", "max-age=10000"],
42+
],
43+
},
44+
{
45+
url_params: "b=2&a=1",
46+
expected_type: "not_cached"
47+
}
48+
]
49+
},
50+
{
51+
name: "When key-order is set , URLs should be compared in an order-insensitive way. Matched cases:",
52+
requests: [
53+
{
54+
url_params: "a=1&b=2",
55+
response_headers: [
56+
["Cache-Control", "max-age=10000"],
57+
["No-Vary-Search", "key-order"],
58+
],
59+
},
60+
{
61+
url_params: "b=2&a=1",
62+
expected_type: "cached"
63+
}
64+
]
65+
},
66+
{
67+
name: "When key-order is set , URLs should be compared in an order-insensitive way. Not matched cases",
68+
requests: [
69+
{
70+
url_params: "a=1&b=2",
71+
response_headers: [
72+
["Cache-Control", "max-age=10000"],
73+
["No-Vary-Search", "key-order"],
74+
],
75+
},
76+
{
77+
url_params: "b=2",
78+
expected_type: "not_cached"
79+
},
80+
{
81+
url_params: "a=2&b=2",
82+
expected_type: "not_cached"
83+
},
84+
{
85+
url_params: "a=1&b=2&c=3",
86+
expected_type: "not_cached"
87+
}
88+
]
3189
}
3290
];
3391
run_tests(tests);

test/fixtures/wpt/resources/chromium/webxr-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,9 @@ class MockRuntime {
956956

957957
this._calculateAnchorInformation(frameData);
958958

959-
this._calculateDepthInformation(frameData);
959+
if (options.depthActive) {
960+
this._calculateDepthInformation(frameData);
961+
}
960962

961963
this._injectAdditionalFrameData(options, frameData);
962964

test/fixtures/wpt/resources/test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,4 @@ def _run_functional_test(self):
263263
@staticmethod
264264
def _assert_sequence(nums):
265265
if nums and len(nums) > 0:
266-
assert nums == list(range(1, nums[-1] + 1))
266+
assert nums == list(range(nums[-1] + 1))

test/fixtures/wpt/resources/testdriver.js

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,57 @@
254254
}
255255
},
256256
/**
257-
* `log <https://w3c.github.io/webdriver-bidi/#module-log>`_ module.
257+
* `emulation <https://www.w3.org/TR/webdriver-bidi/#module-emulation>`_ module.
258+
*/
259+
emulation: {
260+
/**
261+
* Overrides the geolocation coordinates for the specified
262+
* browsing contexts.
263+
* Matches the `emulation.setGeolocationOverride
264+
* <https://w3c.github.io/webdriver-bidi/#command-emulation-setGeolocationOverride>`_
265+
* WebDriver BiDi command.
266+
*
267+
* @example
268+
* await test_driver.bidi.emulation.set_geolocation_override({
269+
* coordinates: {
270+
* latitude: 52.51,
271+
* longitude: 13.39,
272+
* accuracy: 0.5,
273+
* altitude: 34,
274+
* altitudeAccuracy: 0.75,
275+
* heading: 180,
276+
* speed: 2.77
277+
* }
278+
* });
279+
*
280+
* @param {object} params - Parameters for the command.
281+
* @param {null|object} params.coordinates - The optional
282+
* geolocation coordinates to set. Matches the
283+
* `emulation.GeolocationCoordinates <https://w3c.github.io/webdriver-bidi/#type-emulation-GeolocationCoordinates>`_
284+
* value. If null or omitted, the emulation will be removed.
285+
* @param {null|Array.<(Context)>} [params.contexts] The
286+
* optional contexts parameter specifies which browsing contexts
287+
* to set the geolocation override on. It should be either an
288+
* array of Context objects (window or browsing context id), or
289+
* null. If null or omitted, the override will be set on the
290+
* current browsing context.
291+
* @returns {Promise<void>} Resolves when the geolocation
292+
* override is successfully set.
293+
*/
294+
set_geolocation_override: function (params) {
295+
// Ensure the bidi feature is enabled before calling the internal method
296+
assertBidiIsEnabled();
297+
return window.test_driver_internal.bidi.emulation.set_geolocation_override(
298+
params);
299+
},
300+
},
301+
/**
302+
* `log <https://www.w3.org/TR/webdriver-bidi/#module-log>`_ module.
258303
*/
259304
log: {
260305
entry_added: {
261306
/**
262-
* @typedef {object} LogEntryAdded `log.entryAdded <https://w3c.github.io/webdriver-bidi/#event-log-entryAdded>`_ event.
307+
* @typedef {object} LogEntryAdded `log.entryAdded <https://www.w3.org/TR/webdriver-bidi/#event-log-entryAdded>`_ event.
263308
*/
264309

265310
/**
@@ -1576,6 +1621,12 @@
15761621
}
15771622
}
15781623
},
1624+
emulation: {
1625+
set_geolocation_override: function (params) {
1626+
throw new Error(
1627+
"bidi.emulation.set_geolocation_override is not implemented by testdriver-vendor.js");
1628+
}
1629+
},
15791630
log: {
15801631
entry_added: {
15811632
async subscribe() {

0 commit comments

Comments
 (0)