mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-18 18:08:10 +00:00
Migrate more tests to html runner
Implement LocalStorage named get/set (i.e. localStorage["hi"])
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
<script id=localstorage>
|
||||
testing.expectEqual(0, localStorage.length);
|
||||
testing.expectEqual(null, localStorage.getItem('foo'));
|
||||
testing.expectEqual(null, localStorage.key(0));
|
||||
|
||||
localStorage.setItem('foo', 'bar');
|
||||
testing.expectEqual(1, localStorage.length)
|
||||
testing.expectEqual('bar', localStorage.getItem('foo'));
|
||||
testing.expectEqual('bar', localStorage.key(0));
|
||||
testing.expectEqual(null, localStorage.key(1));
|
||||
|
||||
localStorage.removeItem('foo');
|
||||
testing.expectEqual(0, localStorage.length)
|
||||
@@ -19,7 +22,7 @@
|
||||
localStorage.setItem('a', '1');
|
||||
localStorage.setItem('b', '2');
|
||||
localStorage.setItem('c', '3');
|
||||
testing.expectEqual(3, localStorage.length)
|
||||
testing.expectEqual(4, localStorage.length)
|
||||
localStorage.clear();
|
||||
localStorage.length", "0" },
|
||||
testing.expectEqual(0, localStorage.length)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user