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
e38097dc
Commit
e38097dc
authored
11 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for start composing
Bug: 10403176 Change-Id: I510bf1dccf6795426e6fb1b36181b18039a0f435
parent
2448159a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+28
-0
28 additions, 0 deletions
tests/src/com/android/inputmethod/latin/InputLogicTests.java
with
28 additions
and
0 deletions
tests/src/com/android/inputmethod/latin/InputLogicTests.java
+
28
−
0
View file @
e38097dc
...
@@ -305,5 +305,33 @@ public class InputLogicTests extends InputTestsBase {
...
@@ -305,5 +305,33 @@ public class InputLogicTests extends InputTestsBase {
assertEquals
(
"resume suggestion on backspace"
,
8
,
assertEquals
(
"resume suggestion on backspace"
,
8
,
BaseInputConnection
.
getComposingSpanEnd
(
mEditText
.
getText
()));
BaseInputConnection
.
getComposingSpanEnd
(
mEditText
.
getText
()));
}
}
private
void
helperTestComposing
(
final
String
wordToType
,
final
boolean
shouldBeComposing
)
{
mEditText
.
setText
(
""
);
type
(
wordToType
);
assertEquals
(
"start composing inside text"
,
shouldBeComposing
?
0
:
-
1
,
BaseInputConnection
.
getComposingSpanStart
(
mEditText
.
getText
()));
assertEquals
(
"start composing inside text"
,
shouldBeComposing
?
wordToType
.
length
()
:
-
1
,
BaseInputConnection
.
getComposingSpanEnd
(
mEditText
.
getText
()));
}
public
void
testStartComposing
()
{
// Should start composing on a letter
helperTestComposing
(
"a"
,
true
);
type
(
" "
);
// To reset the composing state
// Should not start composing on quote
helperTestComposing
(
"'"
,
false
);
type
(
" "
);
helperTestComposing
(
"'-"
,
false
);
type
(
" "
);
// Should not start composing on dash
helperTestComposing
(
"-"
,
false
);
type
(
" "
);
helperTestComposing
(
"-'"
,
false
);
type
(
" "
);
helperTestComposing
(
"a-"
,
true
);
type
(
" "
);
helperTestComposing
(
"a'"
,
true
);
}
// TODO: Add some tests for non-BMP characters
// TODO: Add some tests for non-BMP characters
}
}
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