OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 // How to create sinon.stubs that work with jscompile. | |
6 // | |
7 // To create the stub: | |
8 // sinon.$setupStub(<object>, <function-name>) | |
9 // | |
10 // To access the stub in unittests: | |
11 // <object>.<function-name>.$testStub.<sinon-test> | |
12 // | |
13 // For example: | |
14 // sinon.$setupStub(chrome.socket, 'create'); | |
15 // chrome.socket.create.$testStub.restore(); | |
16 // | |
17 // For jscompile to analyze these corectly, you'll also need to add an entry | |
18 // in this file for Chrome object you stub out this way. For example: | |
kelvinp
2015/02/26 00:31:30
s/Chrome/any
garykac
2015/02/28 02:33:33
Done.
| |
19 // chrome.socket.create.$testStub = new sinon.$testStub(); | |
20 | |
21 base.debug.assert.$testStub = new sinon.$testStub(); | |
22 base.isAppsV2.$testStub = new sinon.$testStub(); | |
23 | |
24 chrome.i18n.getMessage.$testStub = new sinon.$testStub(); | |
25 | |
26 chrome.socket.connect.$testStub = new sinon.$testStub(); | |
27 chrome.socket.create.$testStub = new sinon.$testStub(); | |
28 chrome.socket.destroy.$testStub = new sinon.$testStub(); | |
29 chrome.socket.read.$testStub = new sinon.$testStub(); | |
30 chrome.socket.secure.$testStub = new sinon.$testStub(); | |
31 chrome.socket.write.$testStub = new sinon.$testStub(); | |
32 | |
33 remoting.xhr.get.$testStub = new sinon.$testStub(); | |
OLD | NEW |