| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/updater/local_extension_cache.h" | 5 #include "chrome/browser/extensions/updater/local_extension_cache.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class LocalExtensionCacheTest : public testing::Test { | 30 class LocalExtensionCacheTest : public testing::Test { |
| 31 public: | 31 public: |
| 32 LocalExtensionCacheTest() {} | 32 LocalExtensionCacheTest() {} |
| 33 virtual ~LocalExtensionCacheTest() {} | 33 virtual ~LocalExtensionCacheTest() {} |
| 34 | 34 |
| 35 scoped_refptr<base::SequencedTaskRunner> background_task_runner() { | 35 scoped_refptr<base::SequencedTaskRunner> background_task_runner() { |
| 36 return background_task_runner_; | 36 return background_task_runner_; |
| 37 } | 37 } |
| 38 | 38 |
| 39 // testing::Test overrides: | 39 // testing::Test overrides: |
| 40 virtual void SetUp() OVERRIDE { | 40 virtual void SetUp() override { |
| 41 pool_owner_.reset( | 41 pool_owner_.reset( |
| 42 new base::SequencedWorkerPoolOwner(3, "Background Pool")); | 42 new base::SequencedWorkerPoolOwner(3, "Background Pool")); |
| 43 background_task_runner_ = pool_owner_->pool()->GetSequencedTaskRunner( | 43 background_task_runner_ = pool_owner_->pool()->GetSequencedTaskRunner( |
| 44 pool_owner_->pool()->GetNamedSequenceToken("background")); | 44 pool_owner_->pool()->GetNamedSequenceToken("background")); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void TearDown() OVERRIDE { | 47 virtual void TearDown() override { |
| 48 pool_owner_->pool()->Shutdown(); | 48 pool_owner_->pool()->Shutdown(); |
| 49 base::RunLoop().RunUntilIdle(); | 49 base::RunLoop().RunUntilIdle(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 base::FilePath CreateCacheDir(bool initialized) { | 52 base::FilePath CreateCacheDir(bool initialized) { |
| 53 EXPECT_TRUE(cache_dir_.CreateUniqueTempDir()); | 53 EXPECT_TRUE(cache_dir_.CreateUniqueTempDir()); |
| 54 if (initialized) | 54 if (initialized) |
| 55 CreateFlagFile(cache_dir_.path()); | 55 CreateFlagFile(cache_dir_.path()); |
| 56 return cache_dir_.path(); | 56 return cache_dir_.path(); |
| 57 } | 57 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 EXPECT_TRUE(base::PathExists( | 164 EXPECT_TRUE(base::PathExists( |
| 165 GetExtensionFileName(cache_dir, kTestExtensionId1, "1.0"))); | 165 GetExtensionFileName(cache_dir, kTestExtensionId1, "1.0"))); |
| 166 EXPECT_FALSE(base::PathExists( | 166 EXPECT_FALSE(base::PathExists( |
| 167 GetExtensionFileName(cache_dir, kTestExtensionId2, "2.0"))); | 167 GetExtensionFileName(cache_dir, kTestExtensionId2, "2.0"))); |
| 168 EXPECT_FALSE(base::PathExists( | 168 EXPECT_FALSE(base::PathExists( |
| 169 GetExtensionFileName(cache_dir, kTestExtensionId3, "3.0"))); | 169 GetExtensionFileName(cache_dir, kTestExtensionId3, "3.0"))); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace extensions | 172 } // namespace extensions |
| OLD | NEW |