-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java][BiDi] implement browsingContext.downloadEnd
event
#16347
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
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 8b155ab
Previous suggestions✅ Suggestions up to commit 173391f
|
java/src/org/openqa/selenium/bidi/browsingcontext/DownloadEnded.java
Outdated
Show resolved
Hide resolved
…d.java Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested minor changes.
|
||
import org.openqa.selenium.json.JsonInput; | ||
|
||
public class DownloadCanceled extends NavigationInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use word "canceled" or "cancelled"?
Both are correct, while "canceled" American English, and "cancelled" is British English.
I've checked that in Selenium Java code,
- "cancelled" is used 17 times, including enum value
Status.CANCELLED
- "canceled" is used 14 times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've actually had this same discussion about this word a few times in my career :)
Unlike "color/colour", "canceled" is pretty commonly used in both American/British English, but more common in American.
Across our entire codebase, the American spelling is the winner:
$ grep -r --ignore-case --exclude-dir=.git 'canceled\|canceling' | wc -l
169
$ grep -r --ignore-case --exclude-dir=.git 'cancelled\|cancelling' | wc -l
164
However, if we exclude 3rd party code we have vendored, British spelling has a slight edge:
$ grep -r --ignore-case --exclude-dir=.git --exclude-dir=common/devtools --exclude-dir=third_party 'canceled\|canceling' | wc -l
77
$ grep -r --ignore-case --exclude-dir=.git --exclude-dir=common/devtools --exclude-dir=third_party 'cancelled\|cancelling' | wc -l
88
So, I'd call it a draw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec uses canceled
, which is a hardcore value for checking downloads.
java/src/org/openqa/selenium/bidi/browsingcontext/DownloadCanceled.java
Outdated
Show resolved
Hide resolved
java/src/org/openqa/selenium/bidi/browsingcontext/DownloadCompleted.java
Outdated
Show resolved
Hide resolved
java/src/org/openqa/selenium/bidi/browsingcontext/DownloadEnded.java
Outdated
Show resolved
Hide resolved
Ruby failure is related to my PR. |
User description
🔗 Related Issues
💥 What does this PR do?
Implements
browsingContext.downloadEnd
event according to spec https://w3c.github.io/webdriver-bidi/#event-browsingContext-downloadEnd for Java binding.ONLY supported for Chrome atm.
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Implement
browsingContext.downloadEnd
event for Java BiDi bindingAdd support for download completion and cancellation states
Create new classes for handling download end scenarios
Update test to verify download end event functionality
Diagram Walkthrough
File Walkthrough
DownloadCanceled.java
Add DownloadCanceled class for canceled downloads
java/src/org/openqa/selenium/bidi/browsingcontext/DownloadCanceled.java
DownloadCompleted.java
Add DownloadCompleted class for successful downloads
java/src/org/openqa/selenium/bidi/browsingcontext/DownloadCompleted.java
DownloadEnded.java
Add DownloadEnded wrapper for download end events
java/src/org/openqa/selenium/bidi/browsingcontext/DownloadEnded.java
BrowsingContextInspector.java
Add download end event support to inspector
java/src/org/openqa/selenium/bidi/module/BrowsingContextInspector.java
BrowsingContextInspectorTest.java
Update test for download end event
java/test/org/openqa/selenium/bidi/browsingcontext/BrowsingContextInspectorTest.java