Index: chrome/test/data/webui/media_router/media_router_container_tests.js |
diff --git a/chrome/test/data/webui/media_router/media_router_container_tests.js b/chrome/test/data/webui/media_router/media_router_container_tests.js |
index 7e8a41b8cd255bf93cee2a8a6190cf52202370c6..2dd95822662b719c1e90c73c2beb996d8c4d69ab 100644 |
--- a/chrome/test/data/webui/media_router/media_router_container_tests.js |
+++ b/chrome/test/data/webui/media_router/media_router_container_tests.js |
@@ -400,6 +400,8 @@ cr.define('media_router_container', function() { |
media_router.SinkStatus.ACTIVE, [1, 2, 3]), |
]; |
+ container.showDomain = true; |
+ |
setTimeout(function() { |
var sinkList = |
container.$['sink-list'].querySelectorAll('paper-item'); |
@@ -416,6 +418,37 @@ cr.define('media_router_container', function() { |
}); |
}); |
+ // Tests that domain text is not shown when |showDomain| is false. |
+ test('sink with domain text', function(done) { |
+ // Sink 1 - sink, no domain -> text = name |
+ // Sink 2 - sink, domain -> text = sink + domain |
+ container.allSinks = [ |
+ new media_router.Sink('sink id 1', 'Sink 1', null, null, |
+ media_router.SinkIconType.HANGOUT, |
+ media_router.SinkStatus.ACTIVE, [1, 2, 3]), |
+ new media_router.Sink('sink id 2', 'Sink 2', |
+ null, 'example.com', |
+ media_router.SinkIconType.HANGOUT, |
+ media_router.SinkStatus.ACTIVE, [1, 2, 3]), |
+ ]; |
+ |
+ container.showDomain = false; |
+ |
+ setTimeout(function() { |
+ var sinkList = |
+ container.$['sink-list'].querySelectorAll('paper-item'); |
+ assertEquals(2, sinkList.length); |
+ |
+ // |sinkList[0]| has sink name only. |
+ checkElementText(container.allSinks[0].name, sinkList[0]); |
+ // |sinkList[1]| has sink name but domain should be hidden. |
+ checkElementText(container.allSinks[1].name, sinkList[1]); |
+ assertTrue(sinkList[1].textContent.trim().indexOf( |
+ container.allSinks[1].domain.trim()) == -1); |
+ done(); |
+ }); |
+ }); |
+ |
// Tests the text shown for the sink list. |
test('initial sink list route text', function(done) { |
// Sink 1 - no sink description, no route -> no subtext |
@@ -513,7 +546,7 @@ cr.define('media_router_container', function() { |
'container-header', |
'device-missing']); |
- // Sc.et a non-blocking issue. The issue should stay hidden. |
+ // Set a non-blocking issue. The issue should stay hidden. |
container.issue = fakeNonBlockingIssue; |
setTimeout(function() { |
checkElementsVisibleWithId(['cast-mode-list', |