tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_table.js (1253B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 /**
      8 * Test getRowColumnSpan.
      9 */
     10 addAccessibleTask(
     11  `
     12 <table>
     13  <tr>
     14    <th id="ab" colspan="2">ab</th>
     15    <td id="cf" rowspan="2">cf</td>
     16  </tr>
     17  <tr>
     18    <td id="d">d</td>
     19    <td>e</td>
     20  </tr>
     21 </table>
     22  `,
     23  async function () {
     24    let result = await runPython(`
     25      global doc
     26      doc = getDoc()
     27      ab = findByDomId(doc, "ab")
     28      return str(ab.queryTableCell().getRowColumnSpan())
     29    `);
     30    is(
     31      result,
     32      "(row=0, column=0, row_span=1, column_span=2)",
     33      "ab getColumnRowSpan correct"
     34    );
     35    result = await runPython(`
     36      cf = findByDomId(doc, "cf")
     37      return str(cf.queryTableCell().getRowColumnSpan())
     38    `);
     39    is(
     40      result,
     41      "(row=0, column=2, row_span=2, column_span=1)",
     42      "cf getColumnRowSpan correct"
     43    );
     44    result = await runPython(`
     45      d = findByDomId(doc, "d")
     46      return str(d.queryTableCell().getRowColumnSpan())
     47    `);
     48    is(
     49      result,
     50      "(row=1, column=0, row_span=1, column_span=1)",
     51      "d getColumnRowSpan correct"
     52    );
     53  }
     54 );