Skip to content

Commit

Permalink
Merge pull request #10238 from keymanapp/fix/web/webview-test-host
Browse files Browse the repository at this point in the history
fix(web): fixes android-webview emulation Web test page
  • Loading branch information
jahorton authored Dec 14, 2023
2 parents d493fdd + 2eae833 commit 31a73e0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions web/src/test/manual/embed/android-harness/host.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
let x = $('#iframe')[0];
let ta = $('#ta')[0];

const TEST_KEYBOARD = {
KN: 'web_context_tests',
KI: 'Keyboard_web_context_tests',
KLC: 'en',
KL: 'English',
KF: 'web_context_tests.js',
KP: 'web_context_tests'
};

window.jsInterface = {
getDeviceType: function() {
return 'AndroidMobile'; // 'AndroidTablet'
Expand Down Expand Up @@ -43,22 +52,14 @@ window.jsInterface = {
dispatchKey(code, eventModifiers) {
console.log('dispatchKey', code, eventModifiers);
},
initialKeyboard() {
return JSON.stringify(TEST_KEYBOARD);
}
};

x.onload = function() {
x.contentWindow.setOskWidth("240");
x.contentWindow.setOskHeight("280");
window.setTimeout(function() {
let reg = {
KN: 'web_context_tests',
KI: 'Keyboard_web_context_tests',
KLC: 'en',
KL: 'English',
KF: 'web_context_tests.js',
KP: 'web_context_tests'
};
x.contentWindow.setKeymanLanguage(reg);
}, 10);
}
x.src='host/keyboard.html';

Expand Down

0 comments on commit 31a73e0

Please sign in to comment.