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

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

Issue 339613003: Remove the blue tool-bar for apps v2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added New Connection to options menu. Created 6 years, 5 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/menu_button_unittest.js
diff --git a/remoting/webapp/unittests/menu_button_unittest.js b/remoting/webapp/unittests/menu_button_unittest.js
index 9e687a4504656bd047d10a99bd1ecb8ae209de06..f09f4abf2e3302f351613c08093e9aad70ec946c 100644
--- a/remoting/webapp/unittests/menu_button_unittest.js
+++ b/remoting/webapp/unittests/menu_button_unittest.js
@@ -7,7 +7,8 @@
'use strict';
var menuButton = null;
-var menuShown = false;
+var onShow = sinon.spy();
+var onHide = sinon.spy();
kelvinp 2014/07/23 18:49:08 To avoid side-effect. We should var onShow = null;
Jamie 2014/07/23 20:00:38 Good catch! Done.
module('MenuButton', {
setup: function() {
@@ -21,8 +22,7 @@ module('MenuButton', {
'</span>';
menuButton = new remoting.MenuButton(
document.getElementById('menu-button-container'),
- function() { menuShown = true; });
- menuShown = false;
+ onShow, onHide);
},
teardown: function() {
}
@@ -57,10 +57,13 @@ test('should dismiss when menu item is clicked', function() {
ok(menu.offsetWidth == 0 && menu.offsetHeight == 0);
});
-test('should invoke callback', function() {
- ok(!menuShown);
+test('should invoke callbacks', function() {
+ ok(!onShow.called);
menuButton.button().click();
- ok(menuShown);
+ ok(onShow.called);
+ ok(!onHide.called);
+ document.body.click();
+ ok(onHide.called);
});
test('select method should set/unset background image', function() {

Powered by Google App Engine
This is Rietveld 408576698