Skip to content

Commit d05feec

Browse files
authored
feat(active): emulate active state on webkit (#941)
1 parent 0d16d14 commit d05feec

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"playwright": {
1111
"chromium_revision": "740289",
1212
"firefox_revision": "1028",
13-
"webkit_revision": "1141"
13+
"webkit_revision": "1143"
1414
},
1515
"scripts": {
1616
"ctest": "cross-env BROWSER=chromium node test/test.js",

src/webkit/wkPage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class WKPage implements PageDelegate {
6868
private async _initializePageProxySession() {
6969
const promises: Promise<any>[] = [
7070
this._pageProxySession.send('Dialog.enable'),
71+
this._pageProxySession.send('Emulation.setActiveAndFocused', { active: true }),
7172
this.authenticate(this._page._state.credentials)
7273
];
7374
const contextOptions = this._page.context()._options;

test/emulation.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* @type {PageTestSuite}
2020
*/
21-
module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) {
21+
module.exports.describe = function({testRunner, expect, playwright, headless, FFOX, CHROMIUM, WEBKIT}) {
2222
const {describe, xdescribe, fdescribe} = testRunner;
2323
const {it, fit, xit, dit} = testRunner;
2424
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
@@ -221,4 +221,9 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
221221
});
222222
});
223223

224+
describe('focus', function() {
225+
it.skip(!headless)('should think that it is focused by default', async({page}) => {
226+
expect(await page.evaluate('document.hasFocus()')).toBe(true);
227+
});
228+
});
224229
};

0 commit comments

Comments
 (0)