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

Unified Diff: chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc

Issue 11146034: Add GetUsageAndQuota() to Syncable API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mihai Review #2 Created 8 years, 2 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
Index: chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc
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 68a4ac3346cf6ebb5f325a38e0e19276e741f245..a137c87cda62e9996bb8379aa6e23db3c446faa5 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
@@ -7,6 +7,7 @@
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/features/feature.h"
+#include "webkit/quota/quota_manager.h"
namespace chrome {
@@ -17,14 +18,32 @@ class SyncFileSystemApiTest : public ExtensionApiTest {
// Override the current channel to "trunk" as syncFileSystem is currently
// available only on trunk channel.
SyncFileSystemApiTest()
- : current_channel_(VersionInfo::CHANNEL_UNKNOWN) {}
+ : current_channel_(VersionInfo::CHANNEL_UNKNOWN) {
+ }
+
+ void SetUp() {
+ // 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 TearDown() {
+ quota::QuotaManager::kSyncableStorageDefaultHostQuota = real_default_quota_;
+ }
private:
extensions::Feature::ScopedCurrentChannel current_channel_;
+ int64 real_default_quota_;
};
} // namespace
+IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetUsageAndQuota) {
+ ASSERT_TRUE(RunExtensionTest("sync_file_system/get_usage_and_quota"))
+ << message_;
+}
+
IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, RequestFileSystem) {
ASSERT_TRUE(RunExtensionTest("sync_file_system/request_file_system"))
<< message_;

Powered by Google App Engine
This is Rietveld 408576698