Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
482588c5
Commit
482588c5
authored
13 years ago
by
Jean Chalard
Committed by
Android (Google) Code Review
13 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Enable DEBUG mode for logic tests."
parents
54c2dd67
bc10e414
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/com/android/inputmethod/latin/InputLogicTests.java
+16
-0
16 additions, 0 deletions
tests/src/com/android/inputmethod/latin/InputLogicTests.java
with
16 additions
and
0 deletions
tests/src/com/android/inputmethod/latin/InputLogicTests.java
+
16
−
0
View file @
482588c5
...
...
@@ -18,6 +18,8 @@ package com.android.inputmethod.latin;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.preference.PreferenceManager
;
import
android.test.ServiceTestCase
;
import
android.text.InputType
;
import
android.util.Log
;
...
...
@@ -35,6 +37,8 @@ import com.android.inputmethod.keyboard.KeyboardActionListener;
public
class
InputLogicTests
extends
ServiceTestCase
<
LatinIME
>
{
private
static
final
String
PREF_DEBUG_MODE
=
"debug_mode"
;
private
LatinIME
mLatinIME
;
private
TextView
mTextView
;
...
...
@@ -42,6 +46,16 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
super
(
LatinIME
.
class
);
}
// returns the previous setting value
private
boolean
setDebugMode
(
final
boolean
mode
)
{
final
SharedPreferences
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
mLatinIME
);
final
boolean
previousDebugSetting
=
prefs
.
getBoolean
(
PREF_DEBUG_MODE
,
false
);
final
SharedPreferences
.
Editor
editor
=
prefs
.
edit
();
editor
.
putBoolean
(
PREF_DEBUG_MODE
,
true
);
editor
.
commit
();
return
previousDebugSetting
;
}
@Override
protected
void
setUp
()
{
try
{
...
...
@@ -54,7 +68,9 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
mTextView
.
setEnabled
(
true
);
setupService
();
mLatinIME
=
getService
();
final
boolean
previousDebugSetting
=
setDebugMode
(
true
);
mLatinIME
.
onCreate
();
setDebugMode
(
previousDebugSetting
);
final
EditorInfo
ei
=
new
EditorInfo
();
final
InputConnection
ic
=
mTextView
.
onCreateInputConnection
(
ei
);
final
LayoutInflater
inflater
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment