Chromium Code Reviews| Index: chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js |
| diff --git a/chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js b/chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js |
| index 51bf561d29de7f6e94db79fbd6e0c7fdec59b2e2..4ae2a1b2e173b54e19aeeaa51a86bb0d1f0dbb34 100644 |
| --- a/chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js |
| +++ b/chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js |
| @@ -33,6 +33,10 @@ window.runCommand = function(command, opt_step) { |
| break; |
| case 'testFocusRestoredRunNextStep': |
| testFocusRestoredRunNextStep(opt_step); |
| + break; |
| + case 'testKeyboardFocusRunNextStep': |
| + testKeyboardFocusRunNextStep(opt_step); |
| + break; |
| default: |
| embedder.test.fail(); |
| } |
| @@ -389,6 +393,35 @@ function testBlurEvent() { |
| }); |
| } |
| +function testKeyboardFocus() { |
| + |
|
alexmos
2016/06/07 22:03:43
no blank line
avallee
2016/06/15 13:32:10
Done.
|
| + embedder.testFocus_(function(webview){ |
|
alexmos
2016/06/07 22:03:43
nit: space before {
avallee
2016/06/15 13:32:10
Done.
|
| + g_webview = webview; |
| + var msg = ['request-createInput']; |
| + webview.contentWindow.postMessage(JSON.stringify(msg), '*'); |
| + chrome.test.sendMessage('TEST_PASSED'); |
| + }, |
| + 'response-inputClicked', |
| + function() { |
| + chrome.test.sendMessage('TEST_STEP_PASSED'); |
| + }); |
| +} |
| + |
| +function testKeyboardFocusRunNextStep(expected) { |
| + g_webview.contentWindow.postMessage( |
| + JSON.stringify(['request-getInputValue']), '*'); |
| + |
| + window.addEventListener('message', function(e) { |
| + var data = JSON.parse(e.data); |
| + LOG('send window.message, data: ' + data); |
| + if (data[0] == 'response-inputValue', data[1] == expected) { |
|
alexmos
2016/06/07 22:03:43
should that comma be &&?
avallee
2016/06/15 13:32:10
Should have been a nested if.
|
| + chrome.test.sendMessage('TEST_STEP_PASSED'); |
| + } else { |
| + chrome.test.sendMessage('TEST_STEP_FAILED'); |
| + } |
| + }); |
| +} |
| + |
| // This test verifies IME related stuff for guest. |
| // |
| // Briefly: |
| @@ -598,6 +631,7 @@ embedder.test.testList = { |
| 'testFocusEvent': testFocusEvent, |
| 'testFocusTracksEmbedder': testFocusTracksEmbedder, |
| 'testInputMethod': testInputMethod, |
| + 'testKeyboardFocus': testKeyboardFocus, |
| 'testFocusRestored': testFocusRestored |
| }; |