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

Return ErrorStatus from webdriver_handlers #23951

Merged
merged 1 commit into from Aug 19, 2019
Merged

Conversation

@georgeroman
Copy link
Contributor

georgeroman commented Aug 11, 2019

With webdriver 0.40, ErrorStatus implements Deserialize. Now we can accommodate for multiple errors occuring in webdriver_handlers.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors

This change is Reviewable

@highfive
Copy link

highfive commented Aug 11, 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 Aug 11, 2019

warning Warning warning

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

georgeroman commented Aug 11, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Aug 11, 2019

Trying commit 5c3d95f with merge 86c1bdf...

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

Return ErrorStatus from webdriver_handlers

<!-- Please describe your changes on the following line: -->
With `webdriver 0.40`, `ErrorStatus` implements `Deserialize`. Now we can accommodate for multiple errors occuring in `webdriver_handlers`.

---
<!-- 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: -->

<!-- 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/23951)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 11, 2019

💔 Test failed - linux-rel-wpt

@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 12, 2019

Hmm, it looks like find_node_by_unique_id fails to find staled elements, as they are reported as not found. Is there a workaround to iterate through all of the elements in a document, including the ones that have been discarded?

@jdm
Copy link
Member

jdm commented Aug 15, 2019

r? @jdm

@highfive highfive assigned jdm and unassigned emilio Aug 15, 2019
@jdm
Copy link
Member

jdm commented Aug 15, 2019

Hmm, it looks like find_node_by_unique_id fails to find staled elements, as they are reported as not found. Is there a workaround to iterate through all of the elements in a document, including the ones that have been discarded?

Right, find_node_by_unique_id only traverses the elements of the active document, which by definition will not find any stale elements. Maybe it's enough to assume that if find_node_by_unique_id returns None then it's a stale element reference?

@jdm
Copy link
Member

jdm commented Aug 15, 2019

Another option would be to store a HashSet of unique IDs ever created in ScriptThread and use that to determine if a element is stale or if there is no such node at all.

@jdm
jdm approved these changes Aug 15, 2019
Copy link
Member

jdm left a comment

These changes generally look fine. I would recommend going with the hashset approach and making find_node_by_unique_id return Result so you can differentiate between stale and nonexistent elements.

@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 16, 2019

I have one question regarding the HashSet approach. I looked over script_thread.rs and I'm not really sure how to go about keeping track of the newly added nodes. Is using a MutationObserver a good choice to do this?

@jdm
Copy link
Member

jdm commented Aug 16, 2019

Rather than a mutation observer, I was imagining that get_unique_id would add an entry to the hash set when it generates an id.

@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 17, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Aug 17, 2019

Trying commit 26726e0 with merge 6ecf31b...

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

Return ErrorStatus from webdriver_handlers

<!-- Please describe your changes on the following line: -->
With `webdriver 0.40`, `ErrorStatus` implements `Deserialize`. Now we can accommodate for multiple errors occuring in `webdriver_handlers`.

---
<!-- 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: -->

<!-- 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/23951)
<!-- Reviewable:end -->
@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 18, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Aug 18, 2019

Trying commit 32bfac5 with merge 3a532ba...

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

Return ErrorStatus from webdriver_handlers

<!-- Please describe your changes on the following line: -->
With `webdriver 0.40`, `ErrorStatus` implements `Deserialize`. Now we can accommodate for multiple errors occuring in `webdriver_handlers`.

---
<!-- 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: -->

<!-- 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/23951)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 18, 2019

💔 Test failed - linux-rel-wpt

@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 18, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Aug 18, 2019

Trying commit d7b9fed with merge 0d9aa56...

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

Return ErrorStatus from webdriver_handlers

<!-- Please describe your changes on the following line: -->
With `webdriver 0.40`, `ErrorStatus` implements `Deserialize`. Now we can accommodate for multiple errors occuring in `webdriver_handlers`.

---
<!-- 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: -->

<!-- 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/23951)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 18, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
State: approved= try=True

@jdm
Copy link
Member

jdm commented Aug 18, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Aug 18, 2019

📌 Commit d7b9fed has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Aug 18, 2019

Testing commit d7b9fed with merge 9dc3bb6...

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

Return ErrorStatus from webdriver_handlers

<!-- Please describe your changes on the following line: -->
With `webdriver 0.40`, `ErrorStatus` implements `Deserialize`. Now we can accommodate for multiple errors occuring in `webdriver_handlers`.

---
<!-- 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: -->

<!-- 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/23951)
<!-- Reviewable:end -->
@jdm jdm mentioned this pull request Aug 18, 2019
2 of 2 tasks complete
@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Aug 19, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

Testing commit d7b9fed with merge 00a9f30...

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

Return ErrorStatus from webdriver_handlers

<!-- Please describe your changes on the following line: -->
With `webdriver 0.40`, `ErrorStatus` implements `Deserialize`. Now we can accommodate for multiple errors occuring in `webdriver_handlers`.

---
<!-- 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: -->

<!-- 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/23951)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

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

@bors-servo bors-servo merged commit d7b9fed into servo:master Aug 19, 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
@bors-servo bors-servo mentioned this pull request Aug 19, 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

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