Add compute pressure-related commands to testdriver#48035
Add compute pressure-related commands to testdriver#48035past merged 2 commits intoweb-platform-tests:masterfrom
Conversation
Spec PR: w3c/compute-pressure#284 This PR adds the required infrastructure to manipulate compute pressure from testdriver. The three new commands correspond to the three WebDriver extension commands added by the spec PR above.
resources/testdriver.js
Outdated
| * @param {String} source_type - A `virtual pressure source type | ||
| * <https://w3c.github.io/compute-pressure/#dom-pressuresource>`_ | ||
| * such as "cpu". | ||
| * @param {String} sample - A `virtual pressure sample |
There was a problem hiding this comment.
Looking at the spec, I think you meant "pressure state" instead of "pressure sample" here.
There was a problem hiding this comment.
Yes in this reference the text talking about the spec should be changed and is changed in this commit 7cc8325
But the spec defines the parameter name as "sample" in Update virtual pressure source -chapter.
Also spec defines "sample" in sentence like "A pressure source
has an associated latest sample".
And in one step of "Update virtual pressure source" service it says
"7. Let sample be the result of invoking get a property "sample" from parameters."
| * virtual pressure source of the given type does not | ||
| * exist). | ||
| */ | ||
| update_virtual_pressure_source: function(source_type, sample, context=null) { |
There was a problem hiding this comment.
sample -> state (or pressure_state)
| throw new Error("create_virtual_pressure_source() is not implemented by testdriver-vendor.js"); | ||
| }, | ||
|
|
||
| async update_virtual_pressure_source(source_type, sample, context=null) { |
| def __call__(self, payload): | ||
| source_type = payload["source_type"] | ||
| sample = payload["sample"] | ||
| return self.protocol.pressure.update_virtual_pressure_source(source_type, sample) |
| return self.webdriver.send_session_command("POST", "pressuresource", body) | ||
|
|
||
| def update_virtual_pressure_source(self, source_type, sample): | ||
| body = {"sample": sample} |
| pass | ||
|
|
||
| @abstractmethod | ||
| def update_virtual_pressure_source(self, source_type, sample): |
| }; | ||
|
|
||
| window.test_driver_internal.update_virtual_pressure_source = function(source_type, sample, context=null) { | ||
| return create_context_action("update_virtual_pressure_source", context, {source_type, sample}); |
…"virtual pressure state"
|
@past Could you check my reply in https://github.com/web-platform-tests/wpt/pull/48035/files/ba89a9af005235fed37148191de4c22ef0ade281#r1753802603 I fixed the document related text in code and explain why the actual variable is named as it is. |
|
Thanks for the explanation, this seems fine to me then. |
Spec PR: w3c/compute-pressure#284
This PR adds the required infrastructure to manipulate compute pressure from testdriver. The three new commands correspond to the three WebDriver extension commands added by the spec PR above.