| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/sync_file_system/drive_backend/sync_engine.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/drive/drive_uploader.h" | 10 #include "chrome/browser/drive/drive_uploader.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 DISALLOW_COPY_AND_ASSIGN(MockSyncTask); | 48 DISALLOW_COPY_AND_ASSIGN(MockSyncTask); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class MockExtensionService : public TestExtensionService { | 51 class MockExtensionService : public TestExtensionService { |
| 52 public: | 52 public: |
| 53 MockExtensionService() {} | 53 MockExtensionService() {} |
| 54 virtual ~MockExtensionService() {} | 54 virtual ~MockExtensionService() {} |
| 55 | 55 |
| 56 virtual const ExtensionSet* extensions() const OVERRIDE { | 56 virtual const extensions::ExtensionSet* extensions() const OVERRIDE { |
| 57 return &extensions_; | 57 return &extensions_; |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual const ExtensionSet* disabled_extensions() const OVERRIDE { | 60 virtual const extensions::ExtensionSet* disabled_extensions() const OVERRIDE { |
| 61 return &disabled_extensions_; | 61 return &disabled_extensions_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual void AddExtension(const extensions::Extension* extension) OVERRIDE { | 64 virtual void AddExtension(const extensions::Extension* extension) OVERRIDE { |
| 65 extensions_.Insert(make_scoped_refptr(extension)); | 65 extensions_.Insert(make_scoped_refptr(extension)); |
| 66 } | 66 } |
| 67 | 67 |
| 68 virtual const extensions::Extension* GetInstalledExtension( | 68 virtual const extensions::Extension* GetInstalledExtension( |
| 69 const std::string& extension_id) const OVERRIDE { | 69 const std::string& extension_id) const OVERRIDE { |
| 70 return extensions_.GetByID(extension_id); | 70 return extensions_.GetByID(extension_id); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 void DisableExtension(const std::string& extension_id) { | 84 void DisableExtension(const std::string& extension_id) { |
| 85 if (!IsExtensionEnabled(extension_id)) | 85 if (!IsExtensionEnabled(extension_id)) |
| 86 return; | 86 return; |
| 87 const extensions::Extension* extension = extensions_.GetByID(extension_id); | 87 const extensions::Extension* extension = extensions_.GetByID(extension_id); |
| 88 disabled_extensions_.Insert(make_scoped_refptr(extension)); | 88 disabled_extensions_.Insert(make_scoped_refptr(extension)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 ExtensionSet extensions_; | 92 extensions::ExtensionSet extensions_; |
| 93 ExtensionSet disabled_extensions_; | 93 extensions::ExtensionSet disabled_extensions_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(MockExtensionService); | 95 DISALLOW_COPY_AND_ASSIGN(MockExtensionService); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 class SyncEngineTest | 98 class SyncEngineTest |
| 99 : public testing::Test, | 99 : public testing::Test, |
| 100 public base::SupportsWeakPtr<SyncEngineTest> { | 100 public base::SupportsWeakPtr<SyncEngineTest> { |
| 101 public: | 101 public: |
| 102 SyncEngineTest() {} | 102 SyncEngineTest() {} |
| 103 virtual ~SyncEngineTest() {} | 103 virtual ~SyncEngineTest() {} |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 base::Bind(&SyncEngineTest::CheckServiceState, | 348 base::Bind(&SyncEngineTest::CheckServiceState, |
| 349 AsWeakPtr(), | 349 AsWeakPtr(), |
| 350 SYNC_STATUS_OK, | 350 SYNC_STATUS_OK, |
| 351 REMOTE_SERVICE_OK)); | 351 REMOTE_SERVICE_OK)); |
| 352 | 352 |
| 353 base::RunLoop().RunUntilIdle(); | 353 base::RunLoop().RunUntilIdle(); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace drive_backend | 356 } // namespace drive_backend |
| 357 } // namespace sync_file_system | 357 } // namespace sync_file_system |
| OLD | NEW |