Chromium Code Reviews| Index: chrome/test/data/webui/media_router/media_router_container_test_base.js |
| diff --git a/chrome/test/data/webui/media_router/media_router_container_test_base.js b/chrome/test/data/webui/media_router/media_router_container_test_base.js |
| index 45d6d64cdeb747ca761c00937bf68affce78cecc..d45c109f581bac4db50547b8046f235a0c204938 100644 |
| --- a/chrome/test/data/webui/media_router/media_router_container_test_base.js |
| +++ b/chrome/test/data/webui/media_router/media_router_container_test_base.js |
| @@ -36,6 +36,20 @@ cr.define('media_router_container_test_base', function() { |
| }; |
| /** |
| + * Checks the visibility of an element. An element is considered visible if |
| + * it exists and its |hidden| property is |false|. |
| + * |
| + * @param {boolean} visible Whether the element should be visible. |
| + * @param {?Element} element The element to test. |
| + * @param {elementId=} elementId Optional element id to display. |
|
apacible
2016/06/08 20:00:53
?string
btolsch
2016/06/08 20:11:14
Done.
|
| + */ |
| + var checkElementVisible = function(visible, element, elementId) { |
| + var elementVisible = !!element && !element.hidden && |
| + element.style.display != 'none'; |
| + assertEquals(visible, elementVisible, elementId); |
| + }; |
| + |
| + /** |
| * Checks the visibility of an element with |elementId| in |container|. |
| * An element is considered visible if it exists and its |hidden| property |
| * is |false|. |
| @@ -45,9 +59,7 @@ cr.define('media_router_container_test_base', function() { |
| */ |
| var checkElementVisibleWithId = function(visible, elementId) { |
| var element = container.$$('#' + elementId); |
| - var elementVisible = !!element && !element.hidden && |
| - element.style.display != 'none'; |
| - assertEquals(visible, elementVisible, elementId); |
| + checkElementVisible(visible, element); |
| }; |
| /** |
| @@ -171,6 +183,7 @@ cr.define('media_router_container_test_base', function() { |
| return { |
| checkCurrentView: checkCurrentView, |
| checkElementsVisibleWithId: checkElementsVisibleWithId, |
| + checkElementVisible: checkElementVisible, |
| checkElementVisibleWithId: checkElementVisibleWithId, |
| checkElementText: checkElementText, |
| fakeBlockingIssue: fakeBlockingIssue, |