| 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 "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "chrome/browser/extensions/event_names.h" | 8 #include "chrome/browser/extensions/event_names.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/sync_file_system/local_change_processor.h" | 10 #include "chrome/browser/sync_file_system/local_change_processor.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 class SyncFileSystemApiTest : public ExtensionApiTest { | 32 class SyncFileSystemApiTest : public ExtensionApiTest { |
| 33 public: | 33 public: |
| 34 // Override the current channel to "trunk" as syncFileSystem is currently | 34 // Override the current channel to "trunk" as syncFileSystem is currently |
| 35 // available only on trunk channel. | 35 // available only on trunk channel. |
| 36 SyncFileSystemApiTest() | 36 SyncFileSystemApiTest() |
| 37 : current_channel_(VersionInfo::CHANNEL_UNKNOWN) { | 37 : current_channel_(VersionInfo::CHANNEL_UNKNOWN) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 void SetUpInProcessBrowserTestFixture() OVERRIDE { | 40 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 41 mock_remote_service_ = new ::testing::NiceMock<MockRemoteFileSyncService>; | 41 mock_remote_service_ = new ::testing::NiceMock<MockRemoteFileSyncService>; |
| 42 SyncFileSystemServiceFactory::GetInstance()->set_mock_remote_file_service( | 42 SyncFileSystemServiceFactory::GetInstance()->set_mock_remote_file_service( |
| 43 scoped_ptr<RemoteFileSyncService>(mock_remote_service_)); | 43 scoped_ptr<RemoteFileSyncService>(mock_remote_service_)); |
| 44 | 44 |
| 45 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 45 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 46 // TODO(calvinlo): Update test code after default quota is made const | 46 // TODO(calvinlo): Update test code after default quota is made const |
| 47 // (http://crbug.com/155488). | 47 // (http://crbug.com/155488). |
| 48 real_default_quota_ = quota::QuotaManager::kSyncableStorageDefaultHostQuota; | 48 real_default_quota_ = quota::QuotaManager::kSyncableStorageDefaultHostQuota; |
| 49 quota::QuotaManager::kSyncableStorageDefaultHostQuota = 123456789; | 49 quota::QuotaManager::kSyncableStorageDefaultHostQuota = 123456789; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void TearDownInProcessBrowserTestFixture() { | 52 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
| 53 quota::QuotaManager::kSyncableStorageDefaultHostQuota = real_default_quota_; | 53 quota::QuotaManager::kSyncableStorageDefaultHostQuota = real_default_quota_; |
| 54 } | 54 } |
| 55 | 55 |
| 56 ::testing::NiceMock<MockRemoteFileSyncService>* mock_remote_service() { | 56 ::testing::NiceMock<MockRemoteFileSyncService>* mock_remote_service() { |
| 57 return mock_remote_service_; | 57 return mock_remote_service_; |
| 58 } | 58 } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 extensions::Feature::ScopedCurrentChannel current_channel_; | 61 extensions::Feature::ScopedCurrentChannel current_channel_; |
| 62 ::testing::NiceMock<MockRemoteFileSyncService>* mock_remote_service_; | 62 ::testing::NiceMock<MockRemoteFileSyncService>* mock_remote_service_; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 | 155 |
| 156 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, WriteFileThenGetUsage) { | 156 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, WriteFileThenGetUsage) { |
| 157 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/write_file_then_get_usage")) | 157 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/write_file_then_get_usage")) |
| 158 << message_; | 158 << message_; |
| 159 } | 159 } |
| 160 | 160 |
| 161 #endif // !defined(OS_CHROMEOS) | 161 #endif // !defined(OS_CHROMEOS) |
| 162 | 162 |
| 163 } // namespace chrome | 163 } // namespace chrome |
| OLD | NEW |