aboutsummaryrefslogtreecommitdiff
path: root/contexts/data/lib/closure-library/closure/goog/testing/mockstorage_test.html
diff options
context:
space:
mode:
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/testing/mockstorage_test.html')
-rw-r--r--contexts/data/lib/closure-library/closure/goog/testing/mockstorage_test.html78
1 files changed, 0 insertions, 78 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/testing/mockstorage_test.html b/contexts/data/lib/closure-library/closure/goog/testing/mockstorage_test.html
deleted file mode 100644
index a36a88a..0000000
--- a/contexts/data/lib/closure-library/closure/goog/testing/mockstorage_test.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-Copyright 2011 The Closure Library Authors. All Rights Reserved.
-
-Use of this source code is governed by the Apache License, Version 2.0.
-See the COPYING file for details.
--->
-<!--
-
--->
-<head>
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<title>Closure Unit Tests - goog.testing.MockStorage</title>
-<script src="../base.js"></script>
-<script>
- goog.require('goog.testing.MockStorage');
- goog.require('goog.testing.jsunit');
-</script>
-</head>
-<body>
-<script>
- var instance;
-
- function setUp() {
- instance = new goog.testing.MockStorage();
- }
-
- /**
- * Tests the MockStorage interface.
- */
- function testMockStorage() {
- assertEquals(0, instance.length);
-
- instance.setItem('foo', 'bar');
- assertEquals(1, instance.length);
- assertEquals('bar', instance.getItem('foo'));
- assertEquals('foo', instance.key(0));
-
- instance.setItem('foo', 'baz');
- assertEquals('baz', instance.getItem('foo'));
-
- instance.setItem('goo', 'gl');
- assertEquals(2, instance.length);
- assertEquals('gl', instance.getItem('goo'));
- assertEquals('goo', instance.key(1));
-
- assertNull(instance.getItem('poogle'));
-
- instance.removeItem('foo');
- assertEquals(1, instance.length);
- assertEquals('goo', instance.key(0));
-
- instance.setItem('a', 12);
- assertEquals('12', instance.getItem('a'));
- instance.setItem('b', false);
- assertEquals('false', instance.getItem('b'));
- instance.setItem('c', {a: 1, b: 12});
- assertEquals('[object Object]', instance.getItem('c'));
-
- instance.clear();
- assertEquals(0, instance.length);
-
- // Test some special cases.
- instance.setItem('emptyString', '');
- assertEquals('', instance.getItem('emptyString'));
- instance.setItem('isNull', null);
- assertEquals('null', instance.getItem('isNull'))
- instance.setItem('isUndefined', undefined);
- assertEquals('undefined', instance.getItem('isUndefined'))
- instance.setItem('', 'empty key');
- assertEquals('empty key', instance.getItem(''));
- assertEquals(4, instance.length);
- }
-
-</script>
-</body>
-</html>