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

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

Issue 1002553002: Refactor sinon helper to make it easier to use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « remoting/webapp/unittests/base_unittest.js ('k') | remoting/webapp/unittests/l10n_unittest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/unittests/host_table_entry_unittest.js
diff --git a/remoting/webapp/unittests/host_table_entry_unittest.js b/remoting/webapp/unittests/host_table_entry_unittest.js
index 7718688339b598dde5b836d72484894628e448e4..9f36d78daf25048ced4c89d497e60ee599dcd62e 100644
--- a/remoting/webapp/unittests/host_table_entry_unittest.js
+++ b/remoting/webapp/unittests/host_table_entry_unittest.js
@@ -28,14 +28,14 @@ module('HostTableEntry', {
'<div id="cancel-host-delete"></div>';
setHost('LocalHost', 'ONLINE');
fixture.appendChild(hostTableEntry_.element());
- sinon.$setupStub(chrome.i18n, 'getMessage', function(/** string */ tag){
+ sinon.stub(chrome.i18n, 'getMessage', function(/** string */ tag){
return tag;
});
},
teardown: function() {
hostTableEntry_.dispose();
hostTableEntry_ = null;
- chrome.i18n.getMessage.$testStub.restore();
+ $testStub(chrome.i18n.getMessage).restore();
}
});
@@ -77,7 +77,7 @@ function verifyVisible(
test('Clicking on the confirm button in the confirm dialog deletes the host',
function() {
// Setup.
- sinon.$setupStub(remoting, 'setMode', function(/** remoting.AppMode */ mode) {
+ sinon.stub(remoting, 'setMode', function(/** remoting.AppMode */ mode) {
if (mode === remoting.AppMode.CONFIRM_HOST_DELETE) {
document.getElementById('confirm-host-delete').click();
}
@@ -90,14 +90,14 @@ test('Clicking on the confirm button in the confirm dialog deletes the host',
sinon.assert.calledWith(onDelete_, hostTableEntry_);
// Cleanup.
- remoting.setMode.$testStub.restore();
+ $testStub(remoting.setMode).restore();
});
test(
'Clicking on the cancel button in the confirm dialog cancels host deletion',
function() {
// Setup.
- sinon.$setupStub(remoting, 'setMode', function(/** remoting.AppMode */ mode) {
+ sinon.stub(remoting, 'setMode', function(/** remoting.AppMode */ mode) {
if (mode === remoting.AppMode.CONFIRM_HOST_DELETE) {
document.getElementById('cancel-host-delete').click();
}
@@ -110,7 +110,7 @@ test(
sinon.assert.notCalled(onDelete_);
// Cleanup.
- remoting.setMode.$testStub.restore();
+ $testStub(remoting.setMode).restore();
});
test('Clicking on the rename button shows the input field.', function() {
@@ -168,7 +168,7 @@ test('HostTableEntry renders an offline host correctly.', function() {
});
test('HostTableEntry renders an out-of-date host correctly', function() {
- sinon.$setupStub(remoting.Host, 'needsUpdate').returns(true);
+ sinon.stub(remoting.Host, 'needsUpdate').returns(true);
setHost('LocalHost', 'ONLINE');
var warningOverlay =
hostTableEntry_.element().querySelector('.warning-overlay');
« no previous file with comments | « remoting/webapp/unittests/base_unittest.js ('k') | remoting/webapp/unittests/l10n_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698