| OLD | NEW |
| 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 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/common/chrome_version_info.h" | 8 #include "chrome/common/chrome_version_info.h" |
| 9 #include "chrome/common/extensions/features/feature.h" | 9 #include "chrome/common/extensions/features/feature.h" |
| 10 #include "webkit/quota/quota_manager.h" |
| 10 | 11 |
| 11 namespace chrome { | 12 namespace chrome { |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 class SyncFileSystemApiTest : public ExtensionApiTest { | 16 class SyncFileSystemApiTest : public ExtensionApiTest { |
| 16 public: | 17 public: |
| 17 // Override the current channel to "trunk" as syncFileSystem is currently | 18 // Override the current channel to "trunk" as syncFileSystem is currently |
| 18 // available only on trunk channel. | 19 // available only on trunk channel. |
| 19 SyncFileSystemApiTest() | 20 SyncFileSystemApiTest() |
| 20 : current_channel_(VersionInfo::CHANNEL_UNKNOWN) {} | 21 : current_channel_(VersionInfo::CHANNEL_UNKNOWN) { |
| 22 } |
| 23 |
| 24 void SetUp() { |
| 25 // TODO(calvinlo): Update test code after default quota is made const |
| 26 // (http://crbug.com/155488). |
| 27 real_default_quota_ = quota::QuotaManager::kSyncableStorageDefaultHostQuota; |
| 28 quota::QuotaManager::kSyncableStorageDefaultHostQuota = 123456789; |
| 29 } |
| 30 |
| 31 void TearDown() { |
| 32 quota::QuotaManager::kSyncableStorageDefaultHostQuota = real_default_quota_; |
| 33 } |
| 21 | 34 |
| 22 private: | 35 private: |
| 23 extensions::Feature::ScopedCurrentChannel current_channel_; | 36 extensions::Feature::ScopedCurrentChannel current_channel_; |
| 37 int64 real_default_quota_; |
| 24 }; | 38 }; |
| 25 | 39 |
| 26 } // namespace | 40 } // namespace |
| 27 | 41 |
| 42 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetUsageAndQuota) { |
| 43 ASSERT_TRUE(RunExtensionTest("sync_file_system/get_usage_and_quota")) |
| 44 << message_; |
| 45 } |
| 46 |
| 28 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, RequestFileSystem) { | 47 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, RequestFileSystem) { |
| 29 ASSERT_TRUE(RunExtensionTest("sync_file_system/request_file_system")) | 48 ASSERT_TRUE(RunExtensionTest("sync_file_system/request_file_system")) |
| 30 << message_; | 49 << message_; |
| 31 } | 50 } |
| 32 | 51 |
| 33 } // namespace chrome | 52 } // namespace chrome |
| OLD | NEW |