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

Side by Side Diff: content/test/data/dom_storage/sanity_check.js

Issue 2593503005: Don't abuse LevelDBObserver interface to pass GetAll result. (Closed)
Patch Set: modify sanity_check test to give async callbacks a chance to cause problems Created 3 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function startTestSoon() { 5 function startTestSoon() {
6 window.setTimeout(test, 0); 6 window.setTimeout(test, 0);
7 } 7 }
8 8
9 function test() { 9 function test() {
10 try { 10 try {
11 debug('Checking window.localStorage'); 11 debug('Checking window.localStorage');
12 sanityCheck(window.localStorage); 12 sanityCheck(window.localStorage);
13 debug('Checking window.sessionStorage'); 13 debug('Checking window.sessionStorage');
14 sanityCheck(window.sessionStorage); 14 sanityCheck(window.sessionStorage);
15 done(); 15 window.setTimeout(done, 0);
16 } catch(e) { 16 } catch(e) {
17 fail(e); 17 fail(e);
18 } 18 }
19 } 19 }
20 20
21 function sanityCheck(storage) { 21 function sanityCheck(storage) {
22 storage["preload"] = "done"; 22 storage["preload"] = "done";
23 checkEqual("done", storage["preload"], 23 checkEqual("done", storage["preload"],
24 "storage['preload'] != 'done' after addition"); 24 "storage['preload'] != 'done' after addition");
25 25
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 function checkEqual(lhs, rhs, errorMessage) { 81 function checkEqual(lhs, rhs, errorMessage) {
82 if (lhs !== rhs) 82 if (lhs !== rhs)
83 throw errorMessage; 83 throw errorMessage;
84 } 84 }
85 85
86 function makeLargeString(minimumSize) { 86 function makeLargeString(minimumSize) {
87 return Array(minimumSize).join("X"); 87 return Array(minimumSize).join("X");
88 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698