| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_unittest.h" | 5 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 this, | 215 this, |
| 216 new ExternalTestingExtensionLoader(json_data, fake_base_path_), | 216 new ExternalTestingExtensionLoader(json_data, fake_base_path_), |
| 217 Extension::EXTERNAL_PREF, | 217 Extension::EXTERNAL_PREF, |
| 218 Extension::EXTERNAL_PREF_DOWNLOAD)); | 218 Extension::EXTERNAL_PREF_DOWNLOAD)); |
| 219 | 219 |
| 220 // We also parse the file into a dictionary to compare what we get back | 220 // We also parse the file into a dictionary to compare what we get back |
| 221 // from the provider. | 221 // from the provider. |
| 222 JSONStringValueSerializer serializer(json_data); | 222 JSONStringValueSerializer serializer(json_data); |
| 223 Value* json_value = serializer.Deserialize(NULL, NULL); | 223 Value* json_value = serializer.Deserialize(NULL, NULL); |
| 224 | 224 |
| 225 if (!json_value || !json_value->IsType(Value::TYPE_DICTIONARY)) { | 225 if (!json_value || !json_value->IsDictionary()) { |
| 226 NOTREACHED() << "Unable to deserialize json data"; | 226 NOTREACHED() << "Unable to deserialize json data"; |
| 227 return -1; | 227 return -1; |
| 228 } else { | 228 } else { |
| 229 DictionaryValue* external_extensions = | 229 DictionaryValue* external_extensions = |
| 230 static_cast<DictionaryValue*>(json_value); | 230 static_cast<DictionaryValue*>(json_value); |
| 231 prefs_.reset(external_extensions); | 231 prefs_.reset(external_extensions); |
| 232 } | 232 } |
| 233 | 233 |
| 234 // Reset our counter. | 234 // Reset our counter. |
| 235 ids_found_ = 0; | 235 ids_found_ = 0; |
| (...skipping 3639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3875 ASSERT_FALSE(AddPendingSyncInstall()); | 3875 ASSERT_FALSE(AddPendingSyncInstall()); |
| 3876 | 3876 |
| 3877 // Wait for the external source to install. | 3877 // Wait for the external source to install. |
| 3878 WaitForCrxInstall(crx_path_, true); | 3878 WaitForCrxInstall(crx_path_, true); |
| 3879 ASSERT_TRUE(IsCrxInstalled()); | 3879 ASSERT_TRUE(IsCrxInstalled()); |
| 3880 | 3880 |
| 3881 // Now that the extension is installed, sync request should fail | 3881 // Now that the extension is installed, sync request should fail |
| 3882 // because the extension is already installed. | 3882 // because the extension is already installed. |
| 3883 ASSERT_FALSE(AddPendingSyncInstall()); | 3883 ASSERT_FALSE(AddPendingSyncInstall()); |
| 3884 } | 3884 } |
| OLD | NEW |