| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 provider_.reset(new extensions::ExternalProviderImpl( | 345 provider_.reset(new extensions::ExternalProviderImpl( |
| 346 this, | 346 this, |
| 347 new extensions::ExternalTestingLoader(json_data, fake_base_path_), | 347 new extensions::ExternalTestingLoader(json_data, fake_base_path_), |
| 348 profile_.get(), | 348 profile_.get(), |
| 349 Manifest::EXTERNAL_PREF, | 349 Manifest::EXTERNAL_PREF, |
| 350 Manifest::EXTERNAL_PREF_DOWNLOAD, | 350 Manifest::EXTERNAL_PREF_DOWNLOAD, |
| 351 Extension::NO_FLAGS)); | 351 Extension::NO_FLAGS)); |
| 352 | 352 |
| 353 // We also parse the file into a dictionary to compare what we get back | 353 // We also parse the file into a dictionary to compare what we get back |
| 354 // from the provider. | 354 // from the provider. |
| 355 JSONStringValueSerializer serializer(json_data); | 355 JSONStringValueDeserializer deserializer(json_data); |
| 356 base::Value* json_value = serializer.Deserialize(NULL, NULL); | 356 base::Value* json_value = deserializer.Deserialize(NULL, NULL); |
| 357 | 357 |
| 358 if (!json_value || !json_value->IsType(base::Value::TYPE_DICTIONARY)) { | 358 if (!json_value || !json_value->IsType(base::Value::TYPE_DICTIONARY)) { |
| 359 NOTREACHED() << "Unable to deserialize json data"; | 359 NOTREACHED() << "Unable to deserialize json data"; |
| 360 return -1; | 360 return -1; |
| 361 } else { | 361 } else { |
| 362 base::DictionaryValue* external_extensions = | 362 base::DictionaryValue* external_extensions = |
| 363 static_cast<base::DictionaryValue*>(json_value); | 363 static_cast<base::DictionaryValue*>(json_value); |
| 364 prefs_.reset(external_extensions); | 364 prefs_.reset(external_extensions); |
| 365 } | 365 } |
| 366 | 366 |
| (...skipping 7311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7678 | 7678 |
| 7679 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, | 7679 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, |
| 7680 content::Source<Profile>(profile()), | 7680 content::Source<Profile>(profile()), |
| 7681 content::NotificationService::NoDetails()); | 7681 content::NotificationService::NoDetails()); |
| 7682 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); | 7682 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); |
| 7683 EXPECT_EQ(0u, registry()->enabled_extensions().size()); | 7683 EXPECT_EQ(0u, registry()->enabled_extensions().size()); |
| 7684 EXPECT_EQ(0u, registry()->disabled_extensions().size()); | 7684 EXPECT_EQ(0u, registry()->disabled_extensions().size()); |
| 7685 EXPECT_EQ(0u, registry()->terminated_extensions().size()); | 7685 EXPECT_EQ(0u, registry()->terminated_extensions().size()); |
| 7686 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); | 7686 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); |
| 7687 } | 7687 } |
| OLD | NEW |