RESOLVED FIXED177405
Web Automation: add commands to get and set mock user permissions for pages in an automation session
https://bugs.webkit.org/show_bug.cgi?id=177405
Summary Web Automation: add commands to get and set mock user permissions for pages i...
Blaze Burg
Reported 2017-09-22 23:05:18 PDT
This patch also implements the first permission, getUserMedia.
Attachments
Patch (11.20 KB, patch)
2017-09-22 23:25 PDT, Blaze Burg
no flags
Patch (11.27 KB, patch)
2017-09-26 09:01 PDT, Blaze Burg
no flags
Blaze Burg
Comment 1 2017-09-22 23:19:15 PDT
Radar WebKit Bug Importer
Comment 2 2017-09-22 23:19:44 PDT
Blaze Burg
Comment 3 2017-09-22 23:25:34 PDT
Carlos Garcia Campos
Comment 4 2017-09-22 23:32:04 PDT
Comment on attachment 321617 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=321617&action=review > Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:1259 > + case Inspector::Protocol::Automation::MockPermission::GetUserMedia: > + m_mockPermissionForGetUserMedia = permissionValue; > + } I would add a break here, even if there aren't more options yet.
Joseph Pecoraro
Comment 5 2017-09-25 16:45:08 PDT
Comment on attachment 321617 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=321617&action=review r=me. You might need a WK2 Owner to approve the UserMediaPermissionRequestManagerProxy change, but the rest looks good to me. > Source/WebKit/UIProcess/Automation/Automation.json:222 > + "id": "MockPermission", I'm not loving the Mock part of this name. Effectively you are setting the permission for the session, so I don't think Mock is necessary. If the intent is to portray that this is unique from the real system / user permissions then replacing Mock with Session would be event clearer. `getMockPermissions` => `getSessionPermissions`. Whether or not Mock stays in the commands below, it doesn't need to be included in these type names. >> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:1259 >> + } > > I would add a break here, even if there aren't more options yet. +1. I'm surprised this didn't get a compiler warning. Maybe we haven't enabled -Wimplicit-fallthrough in all files? I think C++ is supposed to have it thought. > Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:1268 > + Nit: Extra newline.
Blaze Burg
Comment 6 2017-09-26 09:01:00 PDT
Blaze Burg
Comment 7 2017-09-26 09:12:22 PDT
WebKit Commit Bot
Comment 8 2017-09-26 10:12:25 PDT
Comment on attachment 321821 [details] Patch Clearing flags on attachment: 321821 Committed r222503: <http://trac.webkit.org/changeset/222503>
WebKit Commit Bot
Comment 9 2017-09-26 10:12:26 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.