summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcalvinlo@chromium.org <calvinlo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 06:44:07 +0000
committercalvinlo@chromium.org <calvinlo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 06:44:07 +0000
commit7dd262a82fb1e3697a2c68cd062ee2ba4efc43db (patch)
tree4bcef93fc3e6fceb2b4b97cf85607f8135e87ea0
parent157cc900b4c4e4128fc85c39c6a24bde55237a03 (diff)
downloadchromium_src-7dd262a82fb1e3697a2c68cd062ee2ba4efc43db.zip
chromium_src-7dd262a82fb1e3697a2c68cd062ee2ba4efc43db.tar.gz
chromium_src-7dd262a82fb1e3697a2c68cd062ee2ba4efc43db.tar.bz2
Mock quota for syncable file system now that http://code.google.com/p/chromium/issues/detail?id=155242 has landed.
BUG=153501 Review URL: https://chromiumcodereview.appspot.com/11348029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165635 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc15
-rw-r--r--chrome/test/data/extensions/api_test/sync_file_system/get_usage_and_quota/test.js2
2 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc
index 220f15f..13fc994 100644
--- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc
+++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc
@@ -21,15 +21,26 @@ class SyncFileSystemApiTest : public ExtensionApiTest {
: current_channel_(VersionInfo::CHANNEL_UNKNOWN) {
}
+ void SetUpInProcessBrowserTestFixture() OVERRIDE {
+ ExtensionApiTest::SetUpInProcessBrowserTestFixture();
+ // TODO(calvinlo): Update test code after default quota is made const
+ // (http://crbug.com/155488).
+ real_default_quota_ = quota::QuotaManager::kSyncableStorageDefaultHostQuota;
+ quota::QuotaManager::kSyncableStorageDefaultHostQuota = 123456789;
+ }
+
+ void TearDownInProcessBrowserTestFixture() {
+ quota::QuotaManager::kSyncableStorageDefaultHostQuota = real_default_quota_;
+ }
+
private:
extensions::Feature::ScopedCurrentChannel current_channel_;
+ int64 real_default_quota_;
};
} // namespace
IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetUsageAndQuota) {
- // TODO(calvinlo): Check value against mock syncFileSystem quota value instead
- // of comparing against the default. (http://crbug.com/153501).
ASSERT_TRUE(RunExtensionTest("sync_file_system/get_usage_and_quota"))
<< message_;
}
diff --git a/chrome/test/data/extensions/api_test/sync_file_system/get_usage_and_quota/test.js b/chrome/test/data/extensions/api_test/sync_file_system/get_usage_and_quota/test.js
index 8c5c085..68f2e05 100644
--- a/chrome/test/data/extensions/api_test/sync_file_system/get_usage_and_quota/test.js
+++ b/chrome/test/data/extensions/api_test/sync_file_system/get_usage_and_quota/test.js
@@ -10,7 +10,7 @@ chrome.test.runTests([
'drive',
chrome.test.callbackPass(function(info) {
chrome.test.assertEq(0, info.usage_bytes);
- chrome.test.assertEq(524288000, info.quota_bytes);
+ chrome.test.assertEq(123456789, info.quota_bytes);
}));
}
]);