OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * @fileoverview The way these tests work is as follows: | 6 * @fileoverview The way these tests work is as follows: |
7 * C++ in net_internals_ui_browsertest.cc does any necessary setup, and then | 7 * C++ in net_internals_ui_browsertest.cc does any necessary setup, and then |
8 * calls the entry point for a test with RunJavascriptTest. The called | 8 * calls the entry point for a test with RunJavascriptTest. The called |
9 * function can then use the assert/expect functions defined in test_api.js. | 9 * function can then use the assert/expect functions defined in test_api.js. |
10 * All callbacks from the browser are wrapped in such a way that they can | 10 * All callbacks from the browser are wrapped in such a way that they can |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 /** | 131 /** |
132 * Returns the first styled table body that's a descendent of |ancestorId|. | 132 * Returns the first styled table body that's a descendent of |ancestorId|. |
133 * If the specified node is itself a table body node, just returns that node. | 133 * If the specified node is itself a table body node, just returns that node. |
134 * Returns null if no such node is found. | 134 * Returns null if no such node is found. |
135 * @param {string} ancestorId HTML element id containing a styled table. | 135 * @param {string} ancestorId HTML element id containing a styled table. |
136 */ | 136 */ |
137 NetInternalsTest.getStyledTableDescendent = function(ancestorId) { | 137 NetInternalsTest.getStyledTableDescendent = function(ancestorId) { |
138 if ($(ancestorId).nodeName == 'TBODY') | 138 if ($(ancestorId).nodeName == 'TBODY') |
139 return $(ancestorId); | 139 return $(ancestorId); |
140 // The tbody element of the first styled table in |parentId|. | 140 // The tbody element of the first styled table in |parentId|. |
141 return document.querySelector('#' + ancestorId + ' .styledTable tbody'); | 141 return document.querySelector('#' + ancestorId + ' .styled-table tbody'); |
142 }; | 142 }; |
143 | 143 |
144 /** | 144 /** |
145 * Finds the first styled table body that's a descendent of |ancestorId|, | 145 * Finds the first styled table body that's a descendent of |ancestorId|, |
146 * including the |ancestorId| element itself, and returns the number of rows | 146 * including the |ancestorId| element itself, and returns the number of rows |
147 * it has. Returns -1 if there's no such table. | 147 * it has. Returns -1 if there's no such table. |
148 * @param {string} ancestorId HTML element id containing a styled table. | 148 * @param {string} ancestorId HTML element id containing a styled table. |
149 * @return {number} Number of rows the style table's body has. | 149 * @return {number} Number of rows the style table's body has. |
150 */ | 150 */ |
151 NetInternalsTest.getStyledTableNumRows = function(ancestorId) { | 151 NetInternalsTest.getStyledTableNumRows = function(ancestorId) { |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 ]; | 671 ]; |
672 | 672 |
673 for (var i = 0; i < allIds.length; ++i) { | 673 for (var i = 0; i < allIds.length; ++i) { |
674 var curId = allIds[i]; | 674 var curId = allIds[i]; |
675 expectEquals(nodeId == curId, NetInternalsTest.nodeIsVisible($(curId))); | 675 expectEquals(nodeId == curId, NetInternalsTest.nodeIsVisible($(curId))); |
676 } | 676 } |
677 }; | 677 }; |
678 | 678 |
679 return NetInternalsTest; | 679 return NetInternalsTest; |
680 })(); | 680 })(); |
OLD | NEW |