Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: client/tests/client/html/LocalStorageTests.dart

Issue 10139016: Break html_tests.dart into multiple tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/tests/client/html/LocalStorageTest.dart ('k') | client/tests/client/html/MeasurementTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/client/html/LocalStorageTests.dart
diff --git a/client/tests/client/html/LocalStorageTests.dart b/client/tests/client/html/LocalStorageTests.dart
deleted file mode 100644
index 640b1aaac09c8200e5e499097e315d3f415c5c5e..0000000000000000000000000000000000000000
--- a/client/tests/client/html/LocalStorageTests.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-void testLocalStorage() {
- void testWithLocalStorage(String name, fn()) {
- test(name, () {
- window.localStorage['key1'] = 'val1';
- window.localStorage['key2'] = 'val2';
- window.localStorage['key3'] = 'val3';
-
- try {
- fn();
- } finally {
- window.localStorage.clear();
- }
- });
- }
-
- testWithLocalStorage('containsValue', () {
- Expect.isFalse(window.localStorage.containsValue('does not exist'));
- Expect.isFalse(window.localStorage.containsValue('key1'));
- Expect.isTrue(window.localStorage.containsValue('val1'));
- Expect.isTrue(window.localStorage.containsValue('val3'));
- });
-
- testWithLocalStorage('containsKey', () {
- Expect.isFalse(window.localStorage.containsKey('does not exist'));
- Expect.isFalse(window.localStorage.containsKey('val1'));
- Expect.isTrue(window.localStorage.containsKey('key1'));
- Expect.isTrue(window.localStorage.containsKey('key3'));
- });
-
- testWithLocalStorage('[]', () {
- Expect.isNull(window.localStorage['does not exist']);
- Expect.equals('val1', window.localStorage['key1']);
- Expect.equals('val3', window.localStorage['key3']);
- });
-
- testWithLocalStorage('[]=', () {
- Expect.isNull(window.localStorage['key4']);
- window.localStorage['key4'] = 'val4';
- Expect.equals('val4', window.localStorage['key4']);
-
- Expect.equals('val3', window.localStorage['key3']);
- window.localStorage['key3'] = 'val3-new';
- Expect.equals('val3-new', window.localStorage['key3']);
- });
-
- testWithLocalStorage('putIfAbsent', () {
- Expect.isNull(window.localStorage['key4']);
- Expect.equals('val4',
- window.localStorage.putIfAbsent('key4', () => 'val4'));
- Expect.equals('val4', window.localStorage['key4']);
-
- Expect.equals('val3', window.localStorage['key3']);
- Expect.equals('val3', window.localStorage.putIfAbsent(
- 'key3', () => Expect.fail('should not be called')));
- Expect.equals('val3', window.localStorage['key3']);
- });
-
- testWithLocalStorage('remove', () {
- Expect.isNull(window.localStorage.remove('does not exist'));
- Expect.equals('val3', window.localStorage.remove('key3'));
- Expect.mapEquals({'key1': 'val1', 'key2': 'val2'}, window.localStorage);
- });
-
- testWithLocalStorage('clear', () {
- window.localStorage.clear();
- Expect.mapEquals({}, window.localStorage);
- });
-
- testWithLocalStorage('forEach', () {
- Map<String, String> results = {};
- window.localStorage.forEach((k, v) {
- results[k] = v;
- });
- Expect.mapEquals({'key1': 'val1', 'key2': 'val2', 'key3': 'val3'},
- results);
- });
-
- testWithLocalStorage('getKeys', () {
- Expect.setEquals(['key1', 'key2', 'key3'], window.localStorage.getKeys());
- });
-
- testWithLocalStorage('getVals', () {
- Expect.setEquals(['val1', 'val2', 'val3'],
- window.localStorage.getValues());
- });
-
- testWithLocalStorage('length', () {
- Expect.equals(3, window.localStorage.length);
- window.localStorage.clear();
- Expect.equals(0, window.localStorage.length);
- });
-
- testWithLocalStorage('isEmpty', () {
- Expect.isFalse(window.localStorage.isEmpty());
- window.localStorage.clear();
- Expect.isTrue(window.localStorage.isEmpty());
- });
-}
« no previous file with comments | « client/tests/client/html/LocalStorageTest.dart ('k') | client/tests/client/html/MeasurementTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698