Skip to content

Commit

Permalink
browser(firefox): implement Page.bringToFront
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Jul 20, 2020
1 parent d1f937d commit bf6852f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions browser_patches/firefox/BUILD_NUMBER
@@ -1,2 +1,2 @@
1132
Changed: yurys@chromium.org Mon Jul 20 10:26:17 PDT 2020
1133
Changed: pavel.feldman@gmail.com Mon Jul 20 15:11:16 PDT 2020
4 changes: 4 additions & 0 deletions browser_patches/firefox/juggler/protocol/PageHandler.js
Expand Up @@ -179,6 +179,10 @@ class PageHandler {
return await this._contentPage.send('setEmulatedMedia', options);
}

async bringToFront(options) {
this._pageTarget._window.focus();
}

async setCacheDisabled(options) {
return await this._contentPage.send('setCacheDisabled', options);
}
Expand Down
4 changes: 4 additions & 0 deletions browser_patches/firefox/juggler/protocol/Protocol.js
Expand Up @@ -654,6 +654,10 @@ const Page = {
viewportSize: t.Nullable(pageTypes.Size),
},
},
'bringToFront': {
params: {
},
},
'setEmulatedMedia': {
params: {
type: t.Optional(t.Enum(['screen', 'print', ''])),
Expand Down
15 changes: 15 additions & 0 deletions browser_patches/firefox/patches/bootstrap.diff
Expand Up @@ -651,6 +651,21 @@ index e268e2bbe8add1b43f6e4d6507cc7810d707a344..a34a7a292a02ea8d94042475a43ae3a0

dom::MediaCapabilities* MediaCapabilities();
dom::MediaSession* MediaSession();
diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp
index 7fd3b0069dfd8159818c0f80d0c1cee901ce074a..77f08fb399145302677d36003884e9d775cc4e44 100644
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2649,7 +2649,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow,
}
}

- if (sTestMode) {
+ // In Playwright, we still want to execte the embedder functions
+ // to actually show / focus windows.
+ if (false && sTestMode) {
// In test mode, emulate raising the window. WindowRaised takes
// care of lowering the present active window. This happens in
// a separate runnable to avoid touching multiple windows in
diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp
index da9d56e843a2c762dc7d5527712cdd3d30418f7f..aa3d2d6022b60ac3a263c2d1df4eb12714d8e728 100644
--- a/dom/base/nsGlobalWindowOuter.cpp
Expand Down

0 comments on commit bf6852f

Please sign in to comment.