OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 function setCompositionTest() { |
| 6 chrome.experimental.input.ime.setComposition({ |
| 7 "contextID": 1, |
| 8 "text": "Pie", |
| 9 "selectionStart": 1, |
| 10 "selectionEnd": 2, |
| 11 "cursor": 3, |
| 12 "segments": [{ |
| 13 "start": 0, |
| 14 "end": 1, |
| 15 "style": "underline" |
| 16 }] |
| 17 }, chrome.test.callbackPass()); |
| 18 } |
| 19 |
| 20 |
| 21 function clearCompositionTest() { |
| 22 chrome.experimental.input.ime.clearComposition({ |
| 23 "contextID": 1 |
| 24 }, chrome.test.callbackPass()); |
| 25 } |
| 26 |
| 27 |
| 28 function commitTextTest() { |
| 29 chrome.experimental.input.ime.commitText({ |
| 30 "contextID": 2, |
| 31 "text": "Seaguls" |
| 32 }, chrome.test.callbackPass()); |
| 33 } |
| 34 |
| 35 |
| 36 function setCandidateWindowPropertiesTest() { |
| 37 chrome.experimental.input.ime.setCandidateWindowProperties({ |
| 38 "engineID": "test", |
| 39 "properties": { |
| 40 "visible": true, |
| 41 "cursorVisible": false, |
| 42 "vertical": true, |
| 43 "pageSize": 6, |
| 44 "auxiliaryText": "notes", |
| 45 "auxiliaryTextVisible": true |
| 46 } |
| 47 }, chrome.test.callbackPass()); |
| 48 } |
| 49 |
| 50 |
| 51 function setCandidatesTest() { |
| 52 chrome.experimental.input.ime.setCandidates({ |
| 53 "contextID": 8, |
| 54 "candidates": [{ |
| 55 "candidate": "one", |
| 56 "id": 1, |
| 57 "label": "first", |
| 58 "annotation": "The first one" |
| 59 }, { |
| 60 "candidate": "two", |
| 61 "id": 2, |
| 62 "label": "second", |
| 63 "annotation": "The second one" |
| 64 }, { |
| 65 "candidate": "three", |
| 66 "id": 3, |
| 67 "label": "third", |
| 68 "annotation": "The third one" |
| 69 }] |
| 70 }, chrome.test.callbackPass()); |
| 71 } |
| 72 |
| 73 |
| 74 function setCursorPositionTest() { |
| 75 chrome.experimental.input.ime.setCursorPosition({ |
| 76 "contextID": 9, |
| 77 "candidateID": 1 |
| 78 }, chrome.test.callbackPass()); |
| 79 } |
| 80 |
| 81 |
| 82 |
| 83 function setMenuItemsTest() { |
| 84 chrome.experimental.input.ime.setMenuItems({ |
| 85 "engineID": "test", |
| 86 "items": [{ |
| 87 "id": "Menu 1", |
| 88 "label": "Menu 1", |
| 89 "style": "check", |
| 90 "visible": true, |
| 91 "enabled": true |
| 92 }, { |
| 93 "id": "Menu 2", |
| 94 "label": "Menu 2", |
| 95 "style": "radio", |
| 96 "visible": true, |
| 97 "enabled": true |
| 98 }] |
| 99 }, chrome.test.callbackPass()); |
| 100 } |
| 101 |
| 102 function updateMenuItemsTest() { |
| 103 chrome.experimental.input.ime.updateMenuItems({ |
| 104 "engineID": "test", |
| 105 "items": [{ |
| 106 "id": "Menu 1", |
| 107 "enabled": false |
| 108 }, { |
| 109 "id": "Menu 2", |
| 110 "visible": false, |
| 111 }] |
| 112 }, chrome.test.callbackPass()); |
| 113 } |
| 114 |
| 115 chrome.test.runTests([setCompositionTest, clearCompositionTest, |
| 116 commitTextTest, setCandidateWindowPropertiesTest, |
| 117 setCandidatesTest, setCursorPositionTest, |
| 118 setMenuItemsTest, updateMenuItemsTest]); |
OLD | NEW |