mirror of
https://github.com/localForage/localForage.git
synced 2026-01-25 14:44:26 +00:00
62 lines
1.8 KiB
HTML
62 lines
1.8 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>localForage Tests!</title>
|
|
|
|
<link rel="stylesheet" href="/bower_components/mocha/mocha.css">
|
|
|
|
<script src="/bower_components/assert/assert.js"></script>
|
|
<script src="/bower_components/mocha/mocha.js"></script>
|
|
|
|
<script src="/bower_components/expect/index.js"></script>
|
|
|
|
<script>
|
|
|
|
try {
|
|
window.originalIdbOpen = window.indexedDB.open;
|
|
window.indexedDB.open = function faultyIdbOpen() {
|
|
var openreq = {};
|
|
setTimeout(function() {
|
|
if (typeof openreq.onerror === 'function') {
|
|
openreq.onerror(new Event(new Error('OpenDatabase Faulty Driver Test!')));
|
|
}
|
|
});
|
|
return openreq;
|
|
};
|
|
} catch (error) { }
|
|
|
|
try {
|
|
window.originalOpenDatabase = window.openDatabase;
|
|
window.openDatabase = function faultyOpenDatabase() {
|
|
throw new Error('OpenDatabase Faulty Driver Test!');
|
|
};
|
|
} catch (error) { }
|
|
|
|
try {
|
|
window.originalLocalStorageSetItem = window.localStorage.setItem;
|
|
window.localStorage.setItem = function faultySetItemQuotaError() {
|
|
throw new DOMException('The quota has been exceeded.', 'QuotaExceededError');
|
|
};
|
|
|
|
} catch (error) { }
|
|
|
|
</script>
|
|
|
|
<!-- Modernizr -->
|
|
<script src="/bower_components/modernizr/modernizr.js"></script>
|
|
|
|
<!-- Test runner -->
|
|
<script src="/test/runner.js"></script>
|
|
|
|
<!-- localForage -->
|
|
<script src="/dist/localforage.js"></script>
|
|
|
|
<!-- specs -->
|
|
<script src="/test/test.faultydriver.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="mocha"></div>
|
|
</body>
|
|
</html>
|