Index: chrome/test/data/extensions/platform_apps/reinstall_data_cleanup/test.js |
diff --git a/chrome/test/data/extensions/platform_apps/reinstall_data_cleanup/test.js b/chrome/test/data/extensions/platform_apps/reinstall_data_cleanup/test.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5bb833c3556a02f88e8838c4b707039a0a0d9a92 |
--- /dev/null |
+++ b/chrome/test/data/extensions/platform_apps/reinstall_data_cleanup/test.js |
@@ -0,0 +1,31 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+function testChromeStorage(backend, callback) { |
+ backend.get('foo', chrome.test.callbackPass(function(result) { |
+ chrome.test.assertEq(undefined, result.foo, |
+ 'no value should have been found'); |
+ chrome.test.assertEq(undefined, chrome.runtime.lastError); |
+ |
+ // We set the value but also want to make sure it is correctly saved. |
+ backend.set({ 'foo': 'bar' }, chrome.test.callbackPass(function() { |
+ backend.get('foo', chrome.test.callbackPass(function(result) { |
+ chrome.test.assertEq('bar', result.foo, 'value should be written'); |
+ })); |
+ })); |
+ })); |
+} |
+ |
+chrome.app.runtime.onLaunched.addListener(function() { |
+ chrome.test.sendMessage('Launched', function() { |
+ chrome.test.runTests([ |
+ function testChromeStorageLocal() { |
+ testChromeStorage(chrome.storage.local); |
+ }, |
+ function testChromeStorageSync() { |
+ testChromeStorage(chrome.storage.sync); |
+ } |
+ ]); |
+ }); |
+}); |