summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 16:12:50 +0000
committerjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 16:12:50 +0000
commit30cc154d5c043a1f04f3f364b7f0c0f1806b6eeb (patch)
tree2c7a69a886ee6c41e195f28c661769f8f5d4d99d /chrome/test
parent47d79c3e03f495785a27f7fb5992e0a52c097bfd (diff)
downloadchromium_src-30cc154d5c043a1f04f3f364b7f0c0f1806b6eeb.zip
chromium_src-30cc154d5c043a1f04f3f364b7f0c0f1806b6eeb.tar.gz
chromium_src-30cc154d5c043a1f04f3f364b7f0c0f1806b6eeb.tar.bz2
Revert 119598 - Extension Storage API: expose storage quota information to extensions, via:
- exposing the constants as properties on chrome.storage.{sync,local}, and - adding a new API call "getBytesInUse". BUG=110980, 110583, 110663 TEST=unit_tests --gtest_filter=ExtensionSettingsFrontendTest*, browser_tests --gtest_filter=ExtensionSetting* Review URL: http://codereview.chromium.org/9284013 TBR=kalman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9296033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/extensions/api_test/settings/simple_test/background.js46
1 files changed, 1 insertions, 45 deletions
diff --git a/chrome/test/data/extensions/api_test/settings/simple_test/background.js b/chrome/test/data/extensions/api_test/settings/simple_test/background.js
index 7263286..85f5e62 100644
--- a/chrome/test/data/extensions/api_test/settings/simple_test/background.js
+++ b/chrome/test/data/extensions/api_test/settings/simple_test/background.js
@@ -291,55 +291,12 @@ chrome.test.runTests([
test(stage0);
},
-
- function quota() {
- // Just check that the constants are defined; no need to be forced to
- // update them here as well if/when they change.
- chrome.test.assertTrue(chrome.storage.sync.QUOTA_BYTES > 0);
- chrome.test.assertTrue(chrome.storage.sync.QUOTA_BYTES_PER_ITEM > 0);
- chrome.test.assertTrue(chrome.storage.sync.MAX_ITEMS > 0);
-
- chrome.test.assertTrue(chrome.storage.local.QUOTA_BYTES > 0);
- chrome.test.assertEq('undefined',
- typeof chrome.storage.local.QUOTA_BYTES_PER_ITEM);
- chrome.test.assertEq('undefined',
- typeof chrome.storage.local.MAX_ITEMS);
-
- var area = chrome.storage.sync;
- function stage0() {
- area.getBytesInUse(null, stage1);
- }
- function stage1(bytesInUse) {
- chrome.test.assertEq(0, bytesInUse);
- area.set({ a: 42, b: 43, c: 44 }, stage2);
- }
- function stage2() {
- area.getBytesInUse(null, stage3);
- }
- function stage3(bytesInUse) {
- chrome.test.assertEq(9, bytesInUse);
- area.getBytesInUse('a', stage4);
- }
- function stage4(bytesInUse) {
- chrome.test.assertEq(3, bytesInUse);
- area.getBytesInUse(['a', 'b'], stage5);
- }
- function stage5(bytesInUse) {
- chrome.test.assertEq(6, bytesInUse);
- chrome.test.succeed();
- }
- area.clear(stage0);
- },
-
- // NOTE: throttling test must come last, since each test runs with a single
- // quota.
function throttling() {
// We can only really test one of the namespaces since they will all get
// throttled together.
var api = chrome.storage.sync;
- // Should get throttled after 1000 calls (though in reality will be fewer
- // due to previous tests).
+ // Should get throttled after 1000 calls.
var maxRequests = 1001;
function next() {
@@ -353,5 +310,4 @@ chrome.test.runTests([
}
api.clear(next);
}
-
]);