Here, Maybe can be used instead. Also, the returned string is always a literal
string, which makes MimeResultType a trivial type now.
Differential Revision: https://phabricator.services.mozilla.com/D97071
In D97474, I removed this line because I think we acutally didn't need to wait until the focus switched to the original window. However, the intermittent fail rate went high after doing that.
Therefore, adding this line back in order to not interfere the following fullscreen test, which would get failed if the window is not being focused.
Differential Revision: https://phabricator.services.mozilla.com/D97796
A new `BrowsingContext` field has been added to track the active
browser window for the `:-moz-window-inactive` pseudoclass. This
field takes the place of `nsPIDOMWindowOuter::mIsActive`.
With this change `:-moz-window-inactive` is now fission compatible.
Differential Revision: https://phabricator.services.mozilla.com/D86422
`IMEStateManager::OnFocusMovedBetweenBrowsers()` is called by
`BrowserParent::UnsetTopLevelWebFocusAll()` from
`nsFocusManager::WindowRaised()` when a window becomes active from the app
itself is deactivated. At this time, `aBlur` is set to the last
`BrowserParent` which had focus before inactivated, and `aFocus` is always
`nullptr` because of assuming the following code in
`nsFocusManager::WindowRised()` will call `OnFocusMovedBetweenBrowsers()` to
set focus to focused browser part at that time. However, the first call of
`OnFocusMovedBetweenBrowsers()` requesting to commit composition if there is
a composition because it believes that the focused process is just blurred and
nobody would take focus.
So, `IMEStateManager::OnFocusMovedBetweenBrowsers()` needs to wait to handle
its jobs until another its call for setting focus to the remote process when
the app is activated.
Therefore, this patch makes `IMEStateManager` manage whether the process is
active or not from the point of view of IME handling. I.e., in the main
process, it can be treated as active when a window is the focused window in
the desktop, and in a content process, it can be treated as active when the
process has focus. So, this is managed by `sIsActive`.
Then, `IMEStateManager` needs information of first blurred `BrowserParent`
and `last focused `BrowserParent` in the case for putting off to handle its
jobs. Therefore, this patch adds
`IMEStateManager::sPendingFocusedBrowserSwitchingData` to manage them.
Finally, this patch makes `IMEStateManager::OnFocusMovedBetweenBrowsers()`
cancel pending handling if first blurred `BrowserParent` and last focused
`RrowserParent`are same. And also making
`IMEStateManager::OnFocusChangeInternal()` call `OnFocusMoveBetweenBrowsers()`
if there is pending jobs of `OnFocusMoveBetweenBrowsers()`.
UThis requires an API to create the case to all windows deactive to test it.
However, there is no way to do that. Therefore, this patch does not have
any tests.
Differential Revision: https://phabricator.services.mozilla.com/D97687
`keyup` event of `Alt` key should be fired in content process even if it'll
activate the menubar, and it should be cancelable as same as before enabling
e10s.
Unfortunately, the new test is complicated even they test simple things.
The reason is, this test requires the window running it is the active window.
However, the window may become inactive on Linux, therefore, this test
needs to manage window state by itself.
And another reason is, after inactivating the menubar, somebody keeps
consuming keyboard events in chrome. Although, popups shouldn't be
opened by this test, but waiting all popups hidden makes the remaining
intermittent failure gone. Therefore, this patch waits all popups become
hidden after inactivating the menubar and before new test.
Differential Revision: https://phabricator.services.mozilla.com/D95984
As we integrate the event order test to all browser tests, it would better to speed up some tests in order to prevent them from running test too long and cause unnecessary timeout.
- browser_default_action_handler.js
Reduce the amount of tabs we open and test all actions in same tab.
- browser_media_control_non_eligible_media.js
change `testPlayPauseAndStop` to `testNonAudibleMediaCantActivateControllerButAudibleMediaCan`, which would observe the controller's activated state to ensure non-eligible media doesn't activate the controller. And reduce the waiting time we spent on the `checkIfMediaIsStillPlaying`.
For `testNonEligibleMediaEnterFullscreen` and `testNonEligibleMediaEnterPIPMode`, reduce the amount of tab we open and perform checks in the same tab.
- browser_nosrc_and_error_media.js
Don't really need to perform entering PIP mode or fullscreen mode multiple times, because we have set the event listener which would catch error if we activate controller. Doing that only once can also prevent issues caused by entering PIP mode and fullscreen too frequently. (sometime PIP would fail to close its window)
Differential Revision: https://phabricator.services.mozilla.com/D97474
- browser_media_control_keys_event.js
In `testPlayPauseAndStop`, we don't necessary to observe controller's playback state, because we've already observed the media element's play state. However, in `testPlayPause`, we need to observe controller's playback state which determines if we would perform `play` or `pause` on controller.
- browser_media_control_stop_timer.js
When controller stops, listen to its `deactivated` event directly, and make sure we do that before controller stops.
- browser_remove_controllable_media_for_active_controller.js
Ensure we can observe controller's `deactivated` event before it stops.
Differential Revision: https://phabricator.services.mozilla.com/D95363
All media control browser tests are already using new method to create tab, so we don't need the old method anymore.
As `browser_active_mediasession_among_tabs.js` is using them and import media control's `head.js`, remove the usage and use `BrowserTestUtils` method instead.
Differential Revision: https://phabricator.services.mozilla.com/D95362
Those cases work because we would dispatch `metadatachange` before controller gets activated, so we have to modify them.
Differential Revision: https://phabricator.services.mozilla.com/D95361