third_party/material-components-web/test/unit/mdc-ripple/helpers.js
// in cases where window.CSS.supports indicates the feature is supported.
in cases where window.CSS.supports indicates the feature is supported.
in cases where window . CSS . supports indicates the feature is supported .
function createMockWindowForCssVariables() {
  const getComputedStyle = td.func('window.getComputedStyle');
  const remove = () => mockWindow.appendedNodes--;
  const mockDoc = {
    body: {
      appendChild: () => mockWindow.appendedNodes++,
    },
    createElement: td.func('document.createElement'),
  };
  td.when(getComputedStyle(td.matchers.anything())).thenReturn({
    borderTopStyle: 'none',
  });
  td.when(mockDoc.createElement('div')).thenReturn({
    remove: remove,
  });
  const mockWindow = {
    appendedNodes: 0,
    CSS: {
      supports: td.func('.supports'),
    },
    document: mockDoc,
    getComputedStyle: getComputedStyle,
  };
  return mockWindow;
}
function createMockWindowForCssVariables ( ) { const getComputedStyle = td . func ( 'window.getComputedStyle' ) ; const remove = ( ) => mockWindow . appendedNodes -- ; const mockDoc = { body : { appendChild : ( ) => mockWindow . appendedNodes ++ , } , createElement : td . func ( 'document.createElement' ) , } ; td . when ( getComputedStyle ( td . matchers . anything ( ) ) ) . thenReturn ( { borderTopStyle : 'none' , } ) ; td . when ( mockDoc . createElement ( 'div' ) ) . thenReturn ( { remove : remove , } ) ; const mockWindow = { appendedNodes : 0 , CSS : { supports : td . func ( '.supports' ) , } , document : mockDoc , getComputedStyle : getComputedStyle , } ; return mockWindow ; }
in cases where window.CSS.supports indicates the feature is supported.
in cases where window . CSS . supports indicates the feature is supported .
// Expose count of nodes that have been appended and not removed, to be verified in tests