-
-
Notifications
You must be signed in to change notification settings - Fork 801
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
WebDriver: Add headers for Input State and Input Source #1333
base: master
Are you sure you want to change the base?
Conversation
dad5765
to
391609c
Compare
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.
Hi! It's great to have someone tackling this. :^)
I have left rather a lot of comments. 😅 Some are just the same thing in multiple places.
A few more general issues:
- This is all currently "dead code" - nothing uses it. We like all code to be used by something so that we know it works, even if it's just a stub that prints a debug message. I guess this was waiting on WebDriver: Add boilerplate for endpoint 15.7 Perform Actions #1261, but now that's merged you should be able to rebase this branch and start building on that.
- Please read the Coding Style document, and run
clang-format
on your changes before submitting them. There are a few naming convention and formatting issues here. - When adding functions/methods/constructors etc, generally the code for them should go in a .cpp file with the same name. (You'll then need to add that .cpp file to the cmake files so it can compile it. Look for a file named
CMakeLists.txt
in a parent directory, or you can search for a different .cpp file's name and see which one mentions it.) I can see several places here where you've declared a function, and then not implemented it. Please make sure there's an implementation, even if it's just a stub function that just logs a debug message. - I think both these headers look like they'd fit better in
Libraries/LibWeb/WebDriver
, but I'm not an expert on WebDriver so I could be wrong. Maybe wait for someone else's opinion on that. (cc @trflynn89?)
// FIXME: return types, arguments | ||
void keyDown(); | ||
void keyUp(); |
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.
Might be good to just not include these for now, until you know how they need to work. Same for the other "action" methods.
// FIXME: Action object is an object, constructed with fields | ||
// property id, type, and subtype | ||
// this type might not express that | ||
using ActionObject = AK::JsonObject; |
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.
Ideally we'd use a struct or class for this, but the need to set arbitrary keys and values on it makes that tricky, so this might be fine.
private: | ||
// A map where keys are input ids, and the values are input sources. | ||
// Input ids are UUIDs, which are strings | ||
AK::HashMap<AK::String, NonnullOwnPtr<InputSource>> m_input_state_map; |
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.
Because I mentioned OwnPtrs before: Using them here is correct. 👍
Endpoints 15.7 and 15.8 require input state and some associated state around that. This starts to implement that and get some scaffolding around those endpoints Make factory functions for the input sources, partially implement get a pointer id, stub in get the input state
391609c
to
c6f3ea1
Compare
For issue #1040
Endpoints 15.7 and 15.8 require input state and some associated state around that. This starts to implement that and get some scaffolding around those endpoints