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

Unified Diff: chrome/test/data/webui/media_router/media_router_container_test_base.js

Issue 2068593002: [Media Router] Assign each route a current cast mode if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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: 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..e9c84e6b3f7d57a7175887af3e5ce8543c272785 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 {?string} elementId Optional element id to display.
+ */
+ 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,

Powered by Google App Engine
This is Rietveld 408576698