зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1339543 part 3 PuppetWidget should stop getting all edit commands before dispatching keyboard events which are synthesized for tests r=smaug
Synthesized keyboard events in child process doesn't have edit commands when it's being dispatched. With the old design, PuppetWidget needed to store all edit commands for dispatching keyboard event but it's not necessary now because WidgetKeyboardEvent will get only necessary edit commands when WidgetKeyboardEvent::ExecuteEditCommands() is called. So, PuppetWidget should stop calling TabChild::RequestNativeKeyBindings() before dispatching keyboard events. This patch changes browser_audioTabIcon.js which becomes permanent orange with this change. MozReview-Commit-ID: 1eK1mUahRMO --HG-- extra : rebase_source : 13ce4aca8e45fa3d4b739a978bfa7dbddaf58ae3
This commit is contained in:
Родитель
730193bdb6
Коммит
33da02bb41
|
@ -7,7 +7,7 @@ async function wait_for_tab_playing_event(tab, expectPlaying) {
|
|||
ok(true, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
|
||||
return true;
|
||||
}
|
||||
return await BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false, (event) => {
|
||||
return BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false, (event) => {
|
||||
if (event.detail.changed.includes("soundplaying")) {
|
||||
is(tab.hasAttribute("soundplaying"), expectPlaying, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
|
||||
is(tab.soundPlaying, expectPlaying, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
|
||||
|
@ -53,8 +53,6 @@ async function pause(tab, options) {
|
|||
let browser = tab.linkedBrowser;
|
||||
let awaitDOMAudioPlaybackStopped =
|
||||
BrowserTestUtils.waitForEvent(browser, "DOMAudioPlaybackStopped", "DOMAudioPlaybackStopped event should get fired after pause");
|
||||
let awaitTabPausedAttrModified =
|
||||
wait_for_tab_playing_event(tab, false);
|
||||
await ContentTask.spawn(browser, {}, async function() {
|
||||
let audio = content.document.querySelector("audio");
|
||||
audio.pause();
|
||||
|
@ -73,7 +71,7 @@ async function pause(tab, options) {
|
|||
ok(tab.hasAttribute("soundplaying"), "The tab should still have the soundplaying attribute immediately after DOMAudioPlaybackStopped");
|
||||
}
|
||||
|
||||
await awaitTabPausedAttrModified;
|
||||
await wait_for_tab_playing_event(tab, false);
|
||||
ok(!tab.hasAttribute("soundplaying"), "The tab should not have the soundplaying attribute after the timeout has resolved");
|
||||
} finally {
|
||||
// Make sure other tests don't timeout if an exception gets thrown above.
|
||||
|
|
|
@ -348,14 +348,6 @@ PuppetWidget::DispatchEvent(WidgetGUIEvent* aEvent, nsEventStatus& aStatus)
|
|||
"Non-sysnthesized keyboard events should have edit commands for all types "
|
||||
"before dispatched");
|
||||
|
||||
AutoCacheNativeKeyCommands autoCache(this);
|
||||
if (aEvent->mFlags.mIsSynthesizedForTests && !mNativeKeyCommandsValid) {
|
||||
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
|
||||
if (keyEvent) {
|
||||
mTabChild->RequestNativeKeyBindings(&autoCache, keyEvent);
|
||||
}
|
||||
}
|
||||
|
||||
if (aEvent->mClass == eCompositionEventClass) {
|
||||
// Store the latest native IME context of parent process's widget or
|
||||
// TextEventDispatcher if it's in this process.
|
||||
|
|
Загрузка…
Ссылка в новой задаче