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 "chrome/browser/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 std::unique_ptr<extensions::ExternalProviderImpl> provider_; | 487 std::unique_ptr<extensions::ExternalProviderImpl> provider_; |
488 | 488 |
489 std::unique_ptr<base::DictionaryValue> GetDictionaryFromJSON( | 489 std::unique_ptr<base::DictionaryValue> GetDictionaryFromJSON( |
490 const std::string& json_data) { | 490 const std::string& json_data) { |
491 // We also parse the file into a dictionary to compare what we get back | 491 // We also parse the file into a dictionary to compare what we get back |
492 // from the provider. | 492 // from the provider. |
493 JSONStringValueDeserializer deserializer(json_data); | 493 JSONStringValueDeserializer deserializer(json_data); |
494 std::unique_ptr<base::Value> json_value = | 494 std::unique_ptr<base::Value> json_value = |
495 deserializer.Deserialize(NULL, NULL); | 495 deserializer.Deserialize(NULL, NULL); |
496 | 496 |
497 if (!json_value || !json_value->IsType(base::Value::TYPE_DICTIONARY)) { | 497 if (!json_value || !json_value->IsType(base::Value::Type::DICTIONARY)) { |
498 ADD_FAILURE() << "Unable to deserialize json data"; | 498 ADD_FAILURE() << "Unable to deserialize json data"; |
499 return std::unique_ptr<base::DictionaryValue>(); | 499 return std::unique_ptr<base::DictionaryValue>(); |
500 } else { | 500 } else { |
501 return base::DictionaryValue::From(std::move(json_value)); | 501 return base::DictionaryValue::From(std::move(json_value)); |
502 } | 502 } |
503 } | 503 } |
504 | 504 |
505 private: | 505 private: |
506 int ids_found_; | 506 int ids_found_; |
507 base::FilePath fake_base_path_; | 507 base::FilePath fake_base_path_; |
(...skipping 6440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6948 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile()); | 6948 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile()); |
6949 EXPECT_TRUE(registry()->disabled_extensions().Contains(id)); | 6949 EXPECT_TRUE(registry()->disabled_extensions().Contains(id)); |
6950 EXPECT_TRUE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); | 6950 EXPECT_TRUE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); |
6951 | 6951 |
6952 base::FilePath v2_path = data_dir().AppendASCII("good2.crx"); | 6952 base::FilePath v2_path = data_dir().AppendASCII("good2.crx"); |
6953 UpdateExtension(id, v2_path, ENABLED); | 6953 UpdateExtension(id, v2_path, ENABLED); |
6954 | 6954 |
6955 EXPECT_FALSE(registry()->disabled_extensions().Contains(id)); | 6955 EXPECT_FALSE(registry()->disabled_extensions().Contains(id)); |
6956 EXPECT_FALSE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); | 6956 EXPECT_FALSE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); |
6957 } | 6957 } |
OLD | NEW |