mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-06 22:17:29 +00:00
fix(android): fix failing test on Windows
On Windows the tests failed because the AppData directory doesn't yet exist under an allowed app internal storage path. This change creates the directory first when running tests.
This commit is contained in:
parent
aee5620dbf
commit
8f3ce341f8
1 changed files with 9 additions and 1 deletions
|
|
@ -1,5 +1,9 @@
|
|||
/*
|
||||
* Keyman is copyright (C) SIL Global. MIT License.
|
||||
*/
|
||||
package com.keyman.engine;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
|
||||
|
|
@ -32,7 +36,11 @@ public class KMManagerTest {
|
|||
// For some keyboard list tests, load an existing keyboard list.
|
||||
// Can't use @Before because context is null before running tests.
|
||||
public void loadOldKeyboardsList() {
|
||||
KMManager.initialize(ApplicationProvider.getApplicationContext(), KMManager.KeyboardType.KEYBOARD_TYPE_INAPP);
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
// Create appData directory accessed in KMKeyboardWebViewClient
|
||||
File dataDir = context.getDir("data", Context.MODE_PRIVATE);
|
||||
dataDir.mkdirs();
|
||||
KMManager.initialize(context, KMManager.KeyboardType.KEYBOARD_TYPE_INAPP);
|
||||
|
||||
File keyboards_dat = new File(TEST_RESOURCE_ROOT, OLD_KEYBOARDS_LIST);
|
||||
if (keyboards_dat == null || !keyboards_dat.exists()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue