| Index: chrome/test/data/webui/media_router/media_router_container_filter_tests.js
|
| diff --git a/chrome/test/data/webui/media_router/media_router_container_filter_tests.js b/chrome/test/data/webui/media_router/media_router_container_filter_tests.js
|
| index e765555329c22a5807f0e461a2fdf3e5b2177e85..09959eb2f8dc574485ef0104a50559a58c6b4dbe 100644
|
| --- a/chrome/test/data/webui/media_router/media_router_container_filter_tests.js
|
| +++ b/chrome/test/data/webui/media_router/media_router_container_filter_tests.js
|
| @@ -135,12 +135,14 @@ cr.define('media_router_container_filter', function() {
|
| // Tests that focusing the sink search input will cause the container to
|
| // enter filter view.
|
| test('focus sink search input', function(done) {
|
| - MockInteractions.focus(container.$['sink-search-input']);
|
| setTimeout(function() {
|
| - checkCurrentView(media_router.MediaRouterView.FILTER);
|
| - assertEquals(container.$['sink-search-input'],
|
| - container.shadowRoot.activeElement);
|
| - done();
|
| + MockInteractions.focus(container.$['sink-search-input']);
|
| + setTimeout(function() {
|
| + checkCurrentView(media_router.MediaRouterView.FILTER);
|
| + assertEquals(container.$['sink-search-input'],
|
| + container.shadowRoot.activeElement);
|
| + done();
|
| + });
|
| });
|
| });
|
|
|
| @@ -160,11 +162,13 @@ cr.define('media_router_container_filter', function() {
|
| // Tests that pressing the Escape key in the FILTER view returns
|
| // |container| to the SINK_LIST view.
|
| test('filter view escape key', function(done) {
|
| - MockInteractions.tap(container.$['sink-search-icon']);
|
| setTimeout(function() {
|
| - pressEscapeOnElement(container);
|
| - checkCurrentView(media_router.MediaRouterView.SINK_LIST);
|
| - done();
|
| + MockInteractions.tap(container.$['sink-search-icon']);
|
| + setTimeout(function() {
|
| + pressEscapeOnElement(container);
|
| + checkCurrentView(media_router.MediaRouterView.SINK_LIST);
|
| + done();
|
| + });
|
| });
|
| });
|
|
|
| @@ -172,25 +176,28 @@ cr.define('media_router_container_filter', function() {
|
| // keyboard focus returns |container| to the SINK_LIST view and focuses
|
| // the correct sink in the list.
|
| test('filter view escape key on menu item', function(done) {
|
| - container.allSinks = fakeSinkList;
|
| - MockInteractions.tap(container.$['sink-search-icon']);
|
| setTimeout(function() {
|
| - var item =
|
| - container.$$('#search-results').querySelectorAll('paper-item')[1];
|
| - item.focus();
|
| - var focusedSuccess = item.focused;
|
| - pressEscapeOnElement(item);
|
| - checkCurrentView(media_router.MediaRouterView.SINK_LIST);
|
| + container.allSinks = fakeSinkList;
|
| + MockInteractions.tap(container.$['sink-search-icon']);
|
| setTimeout(function() {
|
| - item =
|
| - container.$$('#sink-list-view')
|
| + var item =
|
| + container.$$('#search-results')
|
| .querySelectorAll('paper-item')[1];
|
| - // TODO(crbug.com/608551): This condition handles flakiness around
|
| - // the search item getting focus earlier. If it doesn't get focus,
|
| - // the logic that changes focus from a search item to a sink list
|
| - // item obviously won't do anything.
|
| - assertEquals(focusedSuccess, item.focused);
|
| - done();
|
| + item.focus();
|
| + var focusedSuccess = item.focused;
|
| + pressEscapeOnElement(item);
|
| + checkCurrentView(media_router.MediaRouterView.SINK_LIST);
|
| + setTimeout(function() {
|
| + item =
|
| + container.$$('#sink-list-view')
|
| + .querySelectorAll('paper-item')[1];
|
| + // TODO(crbug.com/608551): This condition handles flakiness around
|
| + // the search item getting focus earlier. If it doesn't get focus,
|
| + // the logic that changes focus from a search item to a sink list
|
| + // item obviously won't do anything.
|
| + assertEquals(focusedSuccess, item.focused);
|
| + done();
|
| + });
|
| });
|
| });
|
| });
|
| @@ -199,22 +206,25 @@ cr.define('media_router_container_filter', function() {
|
| // not have keyboard focus returns |container| to the SINK_LIST view and
|
| // leaves focus where it is.
|
| test('filter view escape key on menu item other focus', function(done) {
|
| - container.allSinks = fakeSinkList;
|
| - MockInteractions.tap(container.$['sink-search-icon']);
|
| setTimeout(function() {
|
| - var item =
|
| - container.$$('#search-results').querySelectorAll('paper-item')[1];
|
| - var closeButton = container.$['container-header'].$['close-button'];
|
| - closeButton.focus();
|
| - var focusedSuccess = closeButton.focused;
|
| - pressEscapeOnElement(item);
|
| - checkCurrentView(media_router.MediaRouterView.SINK_LIST);
|
| + container.allSinks = fakeSinkList;
|
| + MockInteractions.tap(container.$['sink-search-icon']);
|
| setTimeout(function() {
|
| - // TODO(crbug.com/608551): This condition handles flakiness around
|
| - // the button initially getting focus. If it doesn't get focus
|
| - // earlier, it obviously shouldn't have it now.
|
| - assertEquals(focusedSuccess, closeButton.focused);
|
| - done();
|
| + var item =
|
| + container.$$('#search-results')
|
| + .querySelectorAll('paper-item')[1];
|
| + var closeButton = container.$['container-header'].$['close-button'];
|
| + closeButton.focus();
|
| + var focusedSuccess = closeButton.focused;
|
| + pressEscapeOnElement(item);
|
| + checkCurrentView(media_router.MediaRouterView.SINK_LIST);
|
| + setTimeout(function() {
|
| + // TODO(crbug.com/608551): This condition handles flakiness around
|
| + // the button initially getting focus. If it doesn't get focus
|
| + // earlier, it obviously shouldn't have it now.
|
| + assertEquals(focusedSuccess, closeButton.focused);
|
| + done();
|
| + });
|
| });
|
| });
|
| });
|
|
|