summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/test/mochitest/file_indexedDB.html
blob: 65b7e0ad2f4fab7767676c4f2a4f2883c275a5f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <script>
"use strict";

const objectStoreName = "Objects";

let test = {key: 0, value: "test"};

let request = indexedDB.open("WebExtensionTest", 1);
request.onupgradeneeded = event => {
  let db = event.target.result;
  let objectStore = db.createObjectStore(objectStoreName,
                                         {autoIncrement: 0});
  request = objectStore.add(test.value, test.key);
  request.onsuccess = event => {
    db.close();
    window.postMessage("indexedDBCreated", "*");
  };
};
    </script>
  </head>
  <body>
    This is a test page.
  </body>
<html>