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/chromeos/extensions/external_cache.h" | 5 #include "chrome/browser/chromeos/extensions/external_cache.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 content::BrowserThread::GetMessageLoopProxyForThread( | 63 content::BrowserThread::GetMessageLoopProxyForThread( |
64 content::BrowserThread::IO)); | 64 content::BrowserThread::IO)); |
65 fetcher_factory_.reset(new net::TestURLFetcherFactory()); | 65 fetcher_factory_.reset(new net::TestURLFetcherFactory()); |
66 | 66 |
67 pool_owner_.reset( | 67 pool_owner_.reset( |
68 new base::SequencedWorkerPoolOwner(3, "Background Pool")); | 68 new base::SequencedWorkerPoolOwner(3, "Background Pool")); |
69 background_task_runner_ = pool_owner_->pool()->GetSequencedTaskRunner( | 69 background_task_runner_ = pool_owner_->pool()->GetSequencedTaskRunner( |
70 pool_owner_->pool()->GetNamedSequenceToken("background")); | 70 pool_owner_->pool()->GetNamedSequenceToken("background")); |
71 } | 71 } |
72 | 72 |
| 73 void TearDown() override { |
| 74 pool_owner_->pool()->Shutdown(); |
| 75 base::RunLoop().RunUntilIdle(); |
| 76 } |
| 77 |
73 // ExternalCache::Delegate: | 78 // ExternalCache::Delegate: |
74 void OnExtensionListsUpdated(const base::DictionaryValue* prefs) override { | 79 void OnExtensionListsUpdated(const base::DictionaryValue* prefs) override { |
75 prefs_.reset(prefs->DeepCopy()); | 80 prefs_.reset(prefs->DeepCopy()); |
76 } | 81 } |
77 | 82 |
78 std::string GetInstalledExtensionVersion(const std::string& id) override { | 83 std::string GetInstalledExtensionVersion(const std::string& id) override { |
79 std::map<std::string, std::string>::iterator it = | 84 std::map<std::string, std::string>::iterator it = |
80 installed_extensions_.find(id); | 85 installed_extensions_.find(id); |
81 return it != installed_extensions_.end() ? it->second : std::string(); | 86 return it != installed_extensions_.end() ? it->second : std::string(); |
82 } | 87 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1)); | 304 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1)); |
300 EXPECT_TRUE(entry1->HasKey( | 305 EXPECT_TRUE(entry1->HasKey( |
301 extensions::ExternalProviderImpl::kExternalUpdateUrl)); | 306 extensions::ExternalProviderImpl::kExternalUpdateUrl)); |
302 EXPECT_FALSE(entry1->HasKey( | 307 EXPECT_FALSE(entry1->HasKey( |
303 extensions::ExternalProviderImpl::kExternalCrx)); | 308 extensions::ExternalProviderImpl::kExternalCrx)); |
304 EXPECT_FALSE(entry1->HasKey( | 309 EXPECT_FALSE(entry1->HasKey( |
305 extensions::ExternalProviderImpl::kExternalVersion)); | 310 extensions::ExternalProviderImpl::kExternalVersion)); |
306 } | 311 } |
307 | 312 |
308 } // namespace chromeos | 313 } // namespace chromeos |
OLD | NEW |