MCPcopy Index your code
hub / github.com/ampproject/amphtml / resetWindowState

Function resetWindowState

testing/init-tests-helpers.js:130–139  ·  view source on GitHub ↗

* Resets AMP-specific state in the global window object.

()

Source from the content-addressed store, hash-verified

128 * Resets AMP-specific state in the global window object.
129 */
130function resetWindowState() {
131 window.localStorage.clear();
132 window.ENABLE_LOG = false;
133 window.AMP_CONFIG = AMP_CONFIG;
134 window.AMP_DEV_MODE = false;
135 window.context = undefined;
136 window.__AMP_MODE = undefined;
137 window.__AMP_TEST = true;
138 delete window.document['__AMPDOC'];
139}
140
141/**
142 * Resets the window's testing state. Used at the start by initializeTests() and

Callers 2

resetTestingStateFunction · 0.85
cleanupTestcaseFunction · 0.85

Calls 1

clearMethod · 0.65

Tested by

no test coverage detected