File: clear-localstorage.html

package info (click to toggle)
qtwebkit 2.3.4.dfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 290,632 kB
  • sloc: cpp: 1,417,515; python: 85,048; ansic: 39,357; perl: 38,862; ruby: 10,313; objc: 9,505; xml: 8,679; asm: 3,864; yacc: 2,458; sh: 1,237; lex: 813; makefile: 592; java: 228; php: 79
file content (30 lines) | stat: -rw-r--r-- 1,304 bytes parent folder | download | duplicates (4)
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
29
30
<!DOCTYPE html>
<html>
  <body>
    <p>This test case is used to test the function of clear local storage by clicking "Clear Local Storage" button
    from Settings -> Privacy & Security. This is for <a href="https://bugs.webkit.org/show_bug.cgi?id=83253">https://bugs.webkit.org/show_bug.cgi?id=83253</a></p>
    <div>
    <script type="text/javascript">
      if (!sessionStorage.getItem("key")) {
        // initialize test case
        document.write("Status: <span style='color:yellow'>Initial</span>");
        sessionStorage.setItem("key", "value");
        localStorage.setItem("key", "value");

        // notify to clear the local storage and refresh the page.
        document.write("<p>Please clear the local storage from Settings -> Privacy & Security by pressing \"Clear Local Storage\" button, then reload this page to see the result.</p>");
      } else {
        document.write("Result: ");
        if (!localStorage.getItem("key")) {
          // success
          document.write("<span style='color:green'>PASS</span>");
        } else {
          // fail
          document.write("<span style='color:red'>FAIL</span>");
        }
        document.write("<p>If you want to run this test case again, please restart the browser.</p>");
      }
    </script>
    </div>
  </body>
</html>