summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/speculation-rules/prerender/resources/web-database-access.html
blob: fb00852caa9d6eaa0134662b7fe01f085641509e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<script>

const bc = new PrerenderChannel('prerender-channel');
assert_true(document.prerendering);

let result = "Success";
const db = openDatabase("test", "1.0", "test database", 1024);
db.transaction(function (tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS foo (text)');
  tx.executeSql('INSERT INTO foo (text) VALUES ("bar")');
}, function(error) {
  result = error;
}, function() {
  bc.postMessage(result);
  bc.close();
});

</script>