Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2182)

Unified Diff: chrome/test/data/extensions/api_test/input_ime/background.html

Issue 8558013: Add API tests for all input.ime functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/input_ime/background.html
diff --git a/chrome/test/data/extensions/api_test/input_ime/background.html b/chrome/test/data/extensions/api_test/input_ime/background.html
index 02a16c0d86434b40457b40076be19265a073d84f..46170ff26e772e7333f74804bee9eee8519c9eae 100644
--- a/chrome/test/data/extensions/api_test/input_ime/background.html
+++ b/chrome/test/data/extensions/api_test/input_ime/background.html
@@ -1,4 +1,99 @@
<script>
+ function setCompositionTest() {
+ chrome.experimental.input.ime.setComposition({
+ "contextID": 1,
+ "text": "Pie",
+ "selectionStart": 1,
+ "selectionEnd": 2,
+ "segments": [{
+ "start": 0,
+ "end": 1,
+ "style": "underline"
+ }]
+ }, function () {
Matt Perry 2011/11/18 20:16:37 note, you can also wrap the callbacks in a chrome.
Zachary Kuznia 2011/11/21 05:30:21 Done.
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ });
+ }
+
+
+ function clearCompositionTest() {
+ chrome.experimental.input.ime.clearComposition({
+ "contextID": 1
+ }, function () {
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ });
+ }
+
+
+ function commitTextTest() {
+ chrome.experimental.input.ime.commitText({
+ "contextID": 2,
+ "text": "Seaguls"
+ }, function () {
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ });
+ }
+
+
+ function setCandidateWindowPropertiesTest() {
+ chrome.experimental.input.ime.setCandidateWindowProperties({
+ "engineID": "test",
+ "properties": {
+ "visible": true,
+ "cursorVisible": false,
+ "vertical": true,
+ "pageSize": 6,
+ "auxiliaryText": "notes",
+ "auxiliaryTextVisible": true
+ }
+ }, function () {
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ });
+ }
+
+
+ function setCandidatesTest() {
+ chrome.experimental.input.ime.setCandidates({
+ "contextID": 8,
+ "candidates": [{
+ "candidate": "one",
+ "id": 1,
+ "label": "first",
+ "annotation": "The first one"
+ }, {
+ "candidate": "two",
+ "id": 2,
+ "label": "second",
+ "annotation": "The second one"
+ }, {
+ "candidate": "three",
+ "id": 3,
+ "label": "third",
+ "annotation": "The third one"
+ }]
+ }, function () {
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ });
+ }
+
+
+ function setCursorPositionTest() {
+ chrome.experimental.input.ime.setCursorPosition({
+ "contextID": 9,
+ "candidateID": 1
+ }, function () {
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ });
+ }
+
+
+
function setMenuItemsTest() {
chrome.experimental.input.ime.setMenuItems({
"engineID": "test",
@@ -37,5 +132,8 @@
});
}
- chrome.test.runTests([setMenuItemsTest, updateMenuItemsTest]);
+ chrome.test.runTests([setCompositionTest, clearCompositionTest,
+ commitTextTest, setCandidateWindowPropertiesTest,
+ setCandidatesTest, setCursorPositionTest,
+ setMenuItemsTest, updateMenuItemsTest]);
</script>
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698