testMatchCssSelector() {
    const container = dom.createElement(TagName.DIV);
    container.className = 'container';
    const el = dom.createElement(TagName.DIV);
    el.id = 'mydiv';
    el.className = 'colorful foo';
    // set some arbirtrary content
    el.innerHTML = '<div><ul><li>One</li><li>Two</li></ul></div>';
    container.appendChild(el);
    document.body.appendChild(container);

    const elementAncestry = new style.NodeAncestry_(el);
    assertEquals(5, elementAncestry.nodes.length);

    // list of input/output results. Output is the index of the selector
    // that we expect to match - for example, in 'body div div.colorful',
    // 'div.colorful' has an index of 2.
    const expectedResults = [
      ['body div', [4, 1]],
      ['h1', null],
      ['body div h1', [4, 1]],
      ['body div.colorful h1', [4, 1]],
      ['body div div', [4, 2]],
      ['body div div div', [4, 2]],
      ['body div div.somethingelse div', [4, 1]],
      ['body div.somethingelse div', [2, 0]],
      ['div.container', [3, 0]],
      ['div.container div', [4, 1]],
      ['#mydiv', [4, 0]],
      ['div#mydiv', [4, 0]],
      ['div.colorful', [4, 0]],
      ['div#mydiv .colorful', [4, 0]],
      ['.colorful', [4, 0]],
      ['body * div', [4, 2]],
      ['body * *', [4, 2]],
    ];
    for (let i = 0; i < expectedResults.length; i++) {
      const input = expectedResults[i][0];
      const expectedResult = expectedResults[i][1];
      const selector = new style.CssSelector_(input);
      const result =
          /** @type {?} */ (selector.matchElementAncestry(elementAncestry));
      if (expectedResult == null) {
        assertEquals('Expected null result', expectedResult, result);
      } else {
        assertEquals(
            `Expected element index for ${input}`, expectedResult[0],
            result.elementIndex);
        assertEquals(
            `Expected selector part index for ${input}`, expectedResult[1],
            result.selectorPartIndex);
      }
    }
    document.body.removeChild(container);
  }
@suppress {visibility,missingProperties} CssSelector_ property is private
and selectorPartIndex is unknown.