| OLD | NEW |
| 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 /** @fileoverview Prototype for Settings page tests. */ | 5 /** @fileoverview Prototype for Settings page tests. */ |
| 6 | 6 |
| 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ | 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ |
| 8 var ROOT_PATH = '../../../../../'; | 8 var ROOT_PATH = '../../../../../'; |
| 9 | 9 |
| 10 // Polymer BrowserTest fixture. | 10 // Polymer BrowserTest fixture. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if (!pages) | 85 if (!pages) |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 var children = pages.getContentChildren(); | 88 var children = pages.getContentChildren(); |
| 89 var stampedChildren = children.filter(function(element) { | 89 var stampedChildren = children.filter(function(element) { |
| 90 return element.tagName != 'TEMPLATE'; | 90 return element.tagName != 'TEMPLATE'; |
| 91 }); | 91 }); |
| 92 | 92 |
| 93 // The section's main child should be stamped and visible. | 93 // The section's main child should be stamped and visible. |
| 94 var main = stampedChildren.filter(function(element) { | 94 var main = stampedChildren.filter(function(element) { |
| 95 return element.id == 'main'; | 95 return element.getAttribute('route-path') == 'default'; |
| 96 }); | 96 }); |
| 97 assertEquals(main.length, 1, '#main not found for section ' + | 97 assertEquals(main.length, 1, 'default card not found for section ' + |
| 98 section.section); | 98 section.section); |
| 99 assertGT(main[0].offsetHeight, 0); | 99 assertGT(main[0].offsetHeight, 0); |
| 100 | 100 |
| 101 // Any other stamped subpages should not be visible. | 101 // Any other stamped subpages should not be visible. |
| 102 var subpages = stampedChildren.filter(function(element) { | 102 var subpages = stampedChildren.filter(function(element) { |
| 103 return element.id != 'main'; | 103 return element.getAttribute('route-path') != 'default'; |
| 104 }); | 104 }); |
| 105 for (var subpage of subpages) { | 105 for (var subpage of subpages) { |
| 106 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id + | 106 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id + |
| 107 ' in ' + section.section + ' not to be visible.'); | 107 ' in ' + section.section + ' not to be visible.'); |
| 108 } | 108 } |
| 109 }, | 109 }, |
| 110 }; | 110 }; |
| OLD | NEW |