Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for returning array-like types from the Execute(Async)Script wd command #23725

Merged
merged 1 commit into from Aug 10, 2019

Conversation

@georgeroman
Copy link
Contributor

georgeroman commented Jul 6, 2019


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Jul 6, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/webdriver_handlers.rs, components/webdriver_server/lib.rs
  • @jgraham: components/webdriver_server/lib.rs
  • @KiChjang: components/script_traits/webdriver_msg.rs, components/script/webdriver_handlers.rs
@highfive
Copy link

highfive commented Jul 6, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
Copy link
Member

jdm left a comment

Great work here! We can write the code to be a bit more safe, though, particularly when there are problems converting values.

components/script/webdriver_handlers.rs Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
@jdm
Copy link
Member

jdm commented Jul 23, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Jul 23, 2019

📌 Commit 71c5aa5 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jul 24, 2019

Testing commit 71c5aa5 with merge b9bb2bf...

bors-servo added a commit that referenced this pull request Jul 24, 2019
…ute_script, r=jdm

Support for returning array-like types from the Execute(Async)Script wd command

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23725)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 24, 2019

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Jul 24, 2019

{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "test_format_and_dimensions", 
    "test": "/webdriver/tests/take_screenshot/screenshot.py", 
    "line": 14752, 
    "action": "test_result", 
    "expected": "FAIL"
}

This passed on both mac and linux.

@jdm
Copy link
Member

jdm commented Jul 24, 2019

Also ./mach fmt has some changes for you:

Diff in /repo/components/script/webdriver_handlers.rs at line 152:
                 Ok(length) => match length {
                     Some(length) => length,
                     _ => return Err(WebDriverJSError::UnknownType),
-                }
�(B+                },
�(B                 Err(error) => {
                     throw_dom_exception(cx, global_scope, error);
                     return Err(WebDriverJSError::UnknownType);
Diff in /repo/components/script/webdriver_handlers.rs at line 165:
                 Ok(_) => match jsval_to_webdriver(cx, global_scope, item.handle()) {
                     Ok(converted_item) => result.push(converted_item),
                     err @ Err(_) => return err,
-                }
�(B+                },
�(B                 Err(error) => {
                     throw_dom_exception(cx, global_scope, error);
                     return Err(WebDriverJSError::UnknownType);
@highfive highfive removed the S-tests-failed label Aug 8, 2019
@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 8, 2019

Marked the test as failing on Mac. This should now be finally ready.

@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 9, 2019

@bors-servo try=wpt-mac

@bors-servo
Copy link
Contributor

bors-servo commented Aug 9, 2019

Trying commit 639980d with merge 616a5c0...

bors-servo added a commit that referenced this pull request Aug 9, 2019
…ute_script, r=<try>

Support for returning array-like types from the Execute(Async)Script wd command

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23725)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Aug 9, 2019

error[E0308]: mismatched types
   --> components/script/webdriver_handlers.rs:167:41
    |
167 |                     throw_dom_exception(cx, global_scope, error);
    |                                         ^^ expected struct `script_runtime::JSContext`, found *-ptr
    |
    = note: expected type `script_runtime::JSContext`
               found type `*mut js::jsapi::JSContext`
error[E0308]: mismatched types
   --> components/script/webdriver_handlers.rs:180:41
    |
180 |                     throw_dom_exception(cx, global_scope, error);
    |                                         ^^ expected struct `script_runtime::JSContext`, found *-ptr
    |
    = note: expected type `script_runtime::JSContext`
               found type `*mut js::jsapi::JSContext`
error: aborting due to 2 previous errors

This needs to be rebased over #23872.

@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 9, 2019

Done.

@CYBAI
Copy link
Collaborator

CYBAI commented Aug 10, 2019

@bors-servo try=wpt-mac

@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

Trying commit 4f34800 with merge 2033578...

bors-servo added a commit that referenced this pull request Aug 10, 2019
…ute_script, r=<try>

Support for returning array-like types from the Execute(Async)Script wd command

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23725)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Aug 10, 2019

This needs to be updated to accommodate #23941, sadly:

diff --git a/Cargo.lock b/Cargo.lock
index 01766ccf8..2d9696423 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5521,6 +5521,27 @@ dependencies = [
  "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "webdriver"
+version = "0.39.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
+ "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "webdriver"
 version = "0.40.0"
@@ -6337,6 +6358,7 @@ dependencies = [
 "checksum wayland-protocols 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d3f6cebb98963f028d397e9bad2acf9d3b2f6b76fae65aea191edd9e7c0df88c"
 "checksum wayland-scanner 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f1927ee62e4e149c010dc9eca8ca47e238416cd6f45f688eb9f8a8e9c3794c30"
 "checksum wayland-sys 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ca41ed78a12256f81df6f53fcbe4503213ba442e02cdad3c9c888a64a668eaf4"
+"checksum webdriver 0.39.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0533b0b0a05e2e5c081317759a038482806c6085c9605dded03c8bbd2498b042"
 "checksum webdriver 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6949bd7190fdd0eeeaf24d6103fec026856e60d886b2e64f427da1a0f5e590d3"
 "checksum webrender 0.60.0 (git+https://github.com/servo/webrender)" = "<none>"
 "checksum webrender_api 0.60.0 (git+https://github.com/servo/webrender)" = "<none>"
@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 10, 2019

@bors-servo try=wpt-mac

@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

Trying commit 58f80f4 with merge ab7ab6e...

bors-servo added a commit that referenced this pull request Aug 10, 2019
…ute_script, r=<try>

Support for returning array-like types from the Execute(Async)Script wd command

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23725)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

☀️ Test successful - status-taskcluster
State: approved= try=True

@jdm
Copy link
Member

jdm commented Aug 10, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

📌 Commit 58f80f4 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

Testing commit 58f80f4 with merge 79b456d...

bors-servo added a commit that referenced this pull request Aug 10, 2019
…ute_script, r=jdm

Support for returning array-like types from the Execute(Async)Script wd command

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23725)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing 79b456d to master...

@bors-servo bors-servo merged commit 58f80f4 into servo:master Aug 10, 2019
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@georgeroman georgeroman mentioned this pull request Aug 31, 2019
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.