Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_proxy_api.cc ('k') | chrome/browser/extensions/extension_settings_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698