DescriptionUpdate MediaStreamDevicesControllerTest to test with kUsePermissionManagerForMediaRequests feature enabled
This updates MediaStreamDevicesControllerTest to run tests with the
kUsePermissionManagerForMediaRequests flag enabled (as well as without it) by
using a paramaterized test.
A few other changes that were needed to make the test work:
1) |prompt_delegate_| is not used for testing when the feature is enabled.
Instead, |prompt_factory_| is used to check the assumptions about what prompts
are shown. The functions on these 2 objects are slightly different, so
functions in the test harness have been introduced to encapsulate them
(SetPromptResponseType, TotalPromptRequestCount, WasPermissionShown,
ResetPromptCounters).
2) MockPermissionPromptFactory was modified to make it possible to test whether
a specific permission type had been displayed in a prompt.
3) RequestPermissions runs asynchronously. So a RunLoop is used to make
execution of it synchronous for the test.
4) A small bug in PermissionRequestManager::DoAutoResponseForTesting was fixed
where an assumption was made that the function would only be called for single
permission requests (not grouped ones).
BUG=596786
TBR=tommycli@chromium.org
Review-Url: https://codereview.chromium.org/2835863003
Cr-Commit-Position: refs/heads/master@{#468891}
Committed: https://chromium.googlesource.com/chromium/src/+/db97ef8df226e314878defd22582184a6b0f7ec9
Patch Set 1 #Patch Set 2 : MediaStreamDevicesControllerBrowserTest #
Total comments: 2
Patch Set 3 : MediaStreamDevicesControllerBrowserTest #Messages
Total messages: 24 (15 generated)
|