| Index: chrome/test/data/webui/media_router/route_details_tests.js
|
| diff --git a/chrome/test/data/webui/media_router/route_details_tests.js b/chrome/test/data/webui/media_router/route_details_tests.js
|
| index 17451ad511f1fb1050c1f49da766b12d0f197f2d..a07cbb617fb44cf410bdab12ff01aef59954feaf 100644
|
| --- a/chrome/test/data/webui/media_router/route_details_tests.js
|
| +++ b/chrome/test/data/webui/media_router/route_details_tests.js
|
| @@ -48,7 +48,9 @@ cr.define('route_details', function() {
|
| // Checks the default route view is shown.
|
| var checkDefaultViewIsShown = function() {
|
| assertFalse(details.$$('#route-information').hasAttribute('hidden'));
|
| - assertTrue(details.$$('extension-view-wrapper').hasAttribute('hidden'));
|
| + assertTrue(
|
| + !details.$$('extension-view-wrapper') ||
|
| + details.$$('extension-view-wrapper').hasAttribute('hidden'));
|
| };
|
|
|
| // Checks the start button is shown.
|
| @@ -87,7 +89,6 @@ cr.define('route_details', function() {
|
| setup(function(done) {
|
| PolymerTest.clearBody();
|
| details = document.createElement('route-details');
|
| - details.useWebUiRouteControls = false;
|
| document.body.appendChild(details);
|
|
|
| // Initialize routes and sinks.
|
| @@ -209,33 +210,45 @@ cr.define('route_details', function() {
|
|
|
| // Tests when |route| exists, has a custom controller, and it loads.
|
| test('route has custom controller and loading succeeds', function(done) {
|
| - details.$$('extension-view-wrapper').$$('#custom-controller').load =
|
| - function(url) {
|
| - setTimeout(function() {
|
| - assertEquals(
|
| - fakeRouteOneControllerPath,
|
| - url.substring(0, fakeRouteOneControllerPath.length));
|
| - checkCustomControllerIsShown();
|
| - done();
|
| - });
|
| - return Promise.resolve();
|
| - };
|
| + // Get the extension-view-wrapper stamped first, so that we can mock out
|
| + // the load method.
|
| + details.route = fakeRouteTwo;
|
|
|
| - details.route = fakeRouteOne;
|
| + setTimeout(function() {
|
| + details.$$('extension-view-wrapper').$$('#custom-controller').load =
|
| + function(url) {
|
| + setTimeout(function() {
|
| + assertEquals(
|
| + fakeRouteOneControllerPath,
|
| + url.substring(0, fakeRouteOneControllerPath.length));
|
| + checkCustomControllerIsShown();
|
| + done();
|
| + });
|
| + return Promise.resolve();
|
| + };
|
| +
|
| + details.route = fakeRouteOne;
|
| + });
|
| });
|
|
|
| // Tests when |route| exists, has a custom controller, but fails to load.
|
| test('route has custom controller but loading fails', function(done) {
|
| - details.$$('extension-view-wrapper').$$('#custom-controller').load =
|
| - function(url) {
|
| - setTimeout(function() {
|
| - checkDefaultViewIsShown();
|
| - done();
|
| - });
|
| - return Promise.reject();
|
| - };
|
| + // Get the extension-view-wrapper stamped first, so that we can mock out
|
| + // the load method.
|
| + details.route = fakeRouteTwo;
|
|
|
| - details.route = fakeRouteOne;
|
| + setTimeout(function() {
|
| + details.$$('extension-view-wrapper').$$('#custom-controller').load =
|
| + function(url) {
|
| + setTimeout(function() {
|
| + checkDefaultViewIsShown();
|
| + done();
|
| + });
|
| + return Promise.reject();
|
| + };
|
| +
|
| + details.route = fakeRouteOne;
|
| + });
|
| });
|
| });
|
| }
|
|
|