| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 chrome.test.runTests([ | 5 chrome.test.runTests([ |
| 6 function testActivate() { | 6 function testActivate() { |
| 7 var focused = false; | 7 var focused = false; |
| 8 var activated = false; | 8 var activated = false; |
| 9 chrome.input.ime.onFocus.addListener(function(context) { | 9 chrome.input.ime.onFocus.addListener(function(context) { |
| 10 if (context.type == 'none') { | 10 if (context.type == 'none') { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 chrome.test.assertNoLastError() | 45 chrome.test.assertNoLastError() |
| 46 chrome.test.assertTrue(!!win); | 46 chrome.test.assertTrue(!!win); |
| 47 chrome.test.assertTrue(win instanceof Window); | 47 chrome.test.assertTrue(win instanceof Window); |
| 48 chrome.test.assertFalse(win.document.webkitHidden); | 48 chrome.test.assertFalse(win.document.webkitHidden); |
| 49 // test for security origin. | 49 // test for security origin. |
| 50 // If security origin is not correctly set, there will be securtiy | 50 // If security origin is not correctly set, there will be securtiy |
| 51 // exceptions when accessing DOM or add event listeners. | 51 // exceptions when accessing DOM or add event listeners. |
| 52 win.addEventListener('unload', function() {}); | 52 win.addEventListener('unload', function() {}); |
| 53 chrome.test.succeed(); | 53 chrome.test.succeed(); |
| 54 }); | 54 }); |
| 55 }, |
| 56 |
| 57 function testSendKeyEvents() { |
| 58 chrome.input.ime.sendKeyEvents({ |
| 59 'contextID': 1, |
| 60 'keyData': [{ |
| 61 'type': 'keydown', |
| 62 'requestId': '0', |
| 63 'key': 'a', |
| 64 'code': 'KeyA' |
| 65 }, { |
| 66 'type': 'keyup', |
| 67 'requestId': '1', |
| 68 'key': 'a', |
| 69 'code': 'KeyA' |
| 70 }] |
| 71 }); |
| 72 chrome.test.succeed(); |
| 55 } | 73 } |
| 56 ]); | 74 ]); |
| OLD | NEW |