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

Side by Side Diff: chrome/test/media_router/media_router_integration_browsertest.cc

Issue 2674793005: Use allSinks to find a sink in kFindSinkScript. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/media_router/media_router_integration_browsertest.h" 5 #include "chrome/test/media_router/media_router_integration_browsertest.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const char kGetRouteIdScript[] = 76 const char kGetRouteIdScript[] =
77 "var routes = window.document.getElementById('media-router-container')." 77 "var routes = window.document.getElementById('media-router-container')."
78 " routeList;" 78 " routeList;"
79 "for (var i=0; i<routes.length; i++) {" 79 "for (var i=0; i<routes.length; i++) {"
80 " if (routes[i].sinkId == '%s') {" 80 " if (routes[i].sinkId == '%s') {"
81 " domAutomationController.send(routes[i].id);" 81 " domAutomationController.send(routes[i].id);"
82 " }" 82 " }"
83 "}" 83 "}"
84 "domAutomationController.send('');"; 84 "domAutomationController.send('');";
85 const char kFindSinkScript[] = 85 const char kFindSinkScript[] =
86 "var sinks = document.getElementById('media-router-container')." 86 "var sinks = document.getElementById('media-router-container').allSinks;"
imcheng 2017/02/06 21:36:03 I don't think we should be using allSinks, as it i
cliffordcheng1 2017/02/06 23:11:26 The other option is to check if the sink-list is n
87 " shadowRoot.getElementById('sink-list').getElementsByTagName('span');"
88 "for (var i=0; i<sinks.length; i++) {" 87 "for (var i=0; i<sinks.length; i++) {"
89 " if (sinks[i].textContent.trim() == '%s') {" 88 " if (sinks[i].name.trim() == '%s') {"
90 " domAutomationController.send(true);" 89 " domAutomationController.send(true);"
91 "}}" 90 "}}"
92 "domAutomationController.send(false);"; 91 "domAutomationController.send(false);";
93 const char kCheckDialogLoadedScript[] = 92 const char kCheckDialogLoadedScript[] =
94 "var container = document.getElementById('media-router-container');" 93 "var container = document.getElementById('media-router-container');"
95 "/** Wait until media router container is not undefined and " 94 "/** Wait until media router container is not undefined and "
96 "* deviceMissingUrl is not undefined, " 95 "* deviceMissingUrl is not undefined, "
97 "* once deviceMissingUrl is not undefined, which means " 96 "* once deviceMissingUrl is not undefined, which means "
98 "* the dialog is fully loaded." 97 "* the dialog is fully loaded."
99 "*/" 98 "*/"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 628
630 MediaRouterDialogControllerImpl* controller = 629 MediaRouterDialogControllerImpl* controller =
631 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents); 630 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents);
632 EXPECT_TRUE(controller->IsShowingMediaRouterDialog()); 631 EXPECT_TRUE(controller->IsShowingMediaRouterDialog());
633 WaitUntilSinkDiscoveredOnUI(); 632 WaitUntilSinkDiscoveredOnUI();
634 controller->HideMediaRouterDialog(); 633 controller->HideMediaRouterDialog();
635 CheckStartFailed(web_contents, "NotFoundError", "No screens found."); 634 CheckStartFailed(web_contents, "NotFoundError", "No screens found.");
636 } 635 }
637 636
638 } // namespace media_router 637 } // namespace media_router
OLDNEW
« 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