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 | |
78 // ExternalCache::Delegate: | 73 // ExternalCache::Delegate: |
79 void OnExtensionListsUpdated(const base::DictionaryValue* prefs) override { | 74 void OnExtensionListsUpdated(const base::DictionaryValue* prefs) override { |
80 prefs_.reset(prefs->DeepCopy()); | 75 prefs_.reset(prefs->DeepCopy()); |
81 } | 76 } |
82 | 77 |
83 std::string GetInstalledExtensionVersion(const std::string& id) override { | 78 std::string GetInstalledExtensionVersion(const std::string& id) override { |
84 std::map<std::string, std::string>::iterator it = | 79 std::map<std::string, std::string>::iterator it = |
85 installed_extensions_.find(id); | 80 installed_extensions_.find(id); |
86 return it != installed_extensions_.end() ? it->second : std::string(); | 81 return it != installed_extensions_.end() ? it->second : std::string(); |
87 } | 82 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1)); | 299 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1)); |
305 EXPECT_TRUE(entry1->HasKey( | 300 EXPECT_TRUE(entry1->HasKey( |
306 extensions::ExternalProviderImpl::kExternalUpdateUrl)); | 301 extensions::ExternalProviderImpl::kExternalUpdateUrl)); |
307 EXPECT_FALSE(entry1->HasKey( | 302 EXPECT_FALSE(entry1->HasKey( |
308 extensions::ExternalProviderImpl::kExternalCrx)); | 303 extensions::ExternalProviderImpl::kExternalCrx)); |
309 EXPECT_FALSE(entry1->HasKey( | 304 EXPECT_FALSE(entry1->HasKey( |
310 extensions::ExternalProviderImpl::kExternalVersion)); | 305 extensions::ExternalProviderImpl::kExternalVersion)); |
311 } | 306 } |
312 | 307 |
313 } // namespace chromeos | 308 } // namespace chromeos |
OLD | NEW |