Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #28448 from RudyLu/keyboard/Bug928822-dismiss_keyb…
Browse files Browse the repository at this point in the history
…oard

Bug 928822 - Add integration tests for keyboard dismiss.
r=timdream.
  • Loading branch information
RudyLu committed Mar 3, 2015
2 parents 71149de + b55bf81 commit 6d824e3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions apps/keyboard/test/marionette/dismiss_test.js
Expand Up @@ -9,6 +9,7 @@ marionette('Dimiss the keyboard', function() {
var keyboardTestApp = null;
var keyboard = null;
var systemInputMgmt = null;
var system = null;
var actions;

apps[KeyboardTestApp.ORIGIN] = __dirname + '/keyboardtestapp';
Expand All @@ -35,6 +36,7 @@ marionette('Dimiss the keyboard', function() {
setup(function() {
actions = client.loader.getActions();
systemInputMgmt = client.loader.getAppClass('system', 'input_management');
system = client.loader.getAppClass('system');
keyboard = new Keyboard(client);

// create a keyboard test app
Expand Down Expand Up @@ -66,4 +68,28 @@ marionette('Dimiss the keyboard', function() {

assert.ok(keyboardContainer.displayed());
});

test('Click on a non-input field, should dimiss keyboard', function() {
// Switch to test app frame.
client.switchToFrame();
client.apps.switchToApp(KeyboardTestApp.ORIGIN);

keyboardTestApp.nonInputArea.click();

client.waitFor(function() {
return !systemInputMgmt.keyboardFrameDisplayed();
});

assert.ok(true);
});

test('Pressing [Home] button should dimiss keyboard', function() {
system.tapHome();

client.waitFor(function() {
return !systemInputMgmt.keyboardFrameDisplayed();
});

assert.ok(true);
});
});

0 comments on commit 6d824e3

Please sign in to comment.