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

Unified Diff: chrome/test/media_router/media_router_integration_browsertest.cc

Issue 2674793005: Use allSinks to find a sink in kFindSinkScript. (Closed)
Patch Set: Add null check to kFindSinkScript to avoid exception. Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/media_router/media_router_integration_browsertest.cc
diff --git a/chrome/test/media_router/media_router_integration_browsertest.cc b/chrome/test/media_router/media_router_integration_browsertest.cc
index 32a5e7de342edaa59860ce9dde37854c184687d2..35fb3ec1e64f2d1aa26b170712d9c8c288f24159 100644
--- a/chrome/test/media_router/media_router_integration_browsertest.cc
+++ b/chrome/test/media_router/media_router_integration_browsertest.cc
@@ -83,12 +83,14 @@ const char kGetRouteIdScript[] =
"}"
"domAutomationController.send('');";
const char kFindSinkScript[] =
- "var sinks = document.getElementById('media-router-container')."
- " shadowRoot.getElementById('sink-list').getElementsByTagName('span');"
- "for (var i=0; i<sinks.length; i++) {"
- " if (sinks[i].textContent.trim() == '%s') {"
- " domAutomationController.send(true);"
- "}}"
+ "var sinkList = document.getElementById('media-router-container')."
+ " shadowRoot.getElementById('sink-list');"
+ "if (sinkList) {"
+ " var sinks = sinkList.getElementsByTagName('span');"
+ " for (var i=0; i<sinks.length; i++) {"
+ " if (sinks[i].textContent.trim() == '%s') {"
+ " domAutomationController.send(true);"
+ "}}}"
"domAutomationController.send(false);";
const char kCheckDialogLoadedScript[] =
"var container = document.getElementById('media-router-container');"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698