| var span = document.createElement("span"); |
| document.getElementById("console").appendChild(span); |
| span.innerHTML = msg + '<br />'; |
| function escapeHTML(text) |
| return text.replace(/&/g, "&").replace(/</g, "<").replace(/\0/g, "\\0"); |
| debug('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>'); |
| debug('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>'); |
| function shouldThrow(_a, _e) |
| if (typeof _e == "undefined" || exception == _ev) |
| testPassed(_a + " threw exception " + exception + "."); |
| testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Threw exception " + exception + "."); |
| } else if (typeof _av == "undefined") |
| testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was undefined."); |
| testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was " + _av + "."); |
| window.onload = function() { |
| shouldThrow("window.localStorage", "'SecurityError: The operation is insecure.'"); |
| shouldThrow("window.sessionStorage", "'SecurityError: The operation is insecure.'"); |