OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 /** |
| 6 * @fileoverview Fake implementation of chrome.inputMethodPrivate |
| 7 * for testing. |
| 8 */ |
| 9 cr.define('settings', function() { |
| 10 /** |
| 11 * Fake of the chrome.inputMethodsPrivate API. Only methods that are called |
| 12 * during testing have been implemented. |
| 13 * |
| 14 * @constructor |
| 15 * @implements {InputMethodPrivate} |
| 16 */ |
| 17 function FakeInputMethodPrivate() {} |
| 18 |
| 19 FakeInputMethodPrivate.prototype = { |
| 20 getCurrentInputMethod: function(callback) { |
| 21 callback(null); |
| 22 }, |
| 23 |
| 24 get onChanged() { |
| 25 return { |
| 26 addListener: function() { |
| 27 // Nothing to do here. |
| 28 }, |
| 29 removeListener: function() { |
| 30 // Nothing to do here. |
| 31 }, |
| 32 }; |
| 33 }, |
| 34 }; |
| 35 |
| 36 return {FakeInputMethodPrivate: FakeInputMethodPrivate}; |
| 37 }); |
OLD | NEW |