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

Unified Diff: remoting/webapp/unittests/event_hook_unittest.js

Issue 959963002: [Chromoting] Enable jscompile for webapp unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
Index: remoting/webapp/unittests/event_hook_unittest.js
diff --git a/remoting/webapp/unittests/event_hook_unittest.js b/remoting/webapp/unittests/event_hook_unittest.js
index ee67d1f4a300a5b3174352627f159cc350a1c118..ba48e0b4f9c242fb2e2b7bf7557a0759016df11c 100644
--- a/remoting/webapp/unittests/event_hook_unittest.js
+++ b/remoting/webapp/unittests/event_hook_unittest.js
@@ -6,17 +6,29 @@
'use strict';
+/** @type {base.EventSourceImpl} */
var eventSource = null;
+
+/** @type {HTMLElement} */
var domElement = null;
+
+/** @type {chrome.Event} */
var myChromeEvent = null;
+
+/** @type {Listener} */
var listener = null;
+/** @constructor */
var Listener = function(element) {
- this.onChromeEvent = sinon.stub();
- this.onClickEvent = sinon.stub();
- this.onCustomEvent = sinon.stub();
+ /** @type {(sinon.$spy|function(...?))} */
+ this.onChromeEvent = sinon.spy();
+ /** @type {(sinon.$spy|function(...?))} */
+ this.onClickEvent = sinon.spy();
+ /** @type {(sinon.$spy|function(...?))} */
+ this.onCustomEvent = sinon.spy();
+
this.eventHooks_ = new base.Disposables(
- new base.DomEventHook(element, 'click', this.onClickEvent.bind(this),
+ new base.DomEventHook(domElement, 'click', this.onClickEvent.bind(this),
kelvinp 2015/02/26 00:31:30 should be element as it is passed through the cons
garykac 2015/02/28 02:33:33 I didn't see the 'element' param and thought it wa
false),
new base.EventHook(eventSource, 'customEvent',
this.onCustomEvent.bind(this)),
@@ -35,10 +47,10 @@ function raiseAllEvents() {
module('base.EventHook', {
setup: function() {
- domElement = document.createElement('div');
+ domElement = /** @type {HTMLElement} */ (document.createElement('div'));
eventSource = new base.EventSourceImpl();
eventSource.defineEvents(['customEvent']);
- myChromeEvent = new chromeMocks.Event();
+ myChromeEvent = new chrome.Event();
listener = new Listener(domElement);
},
tearDown: function() {

Powered by Google App Engine
This is Rietveld 408576698