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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "chrome/browser/extensions/component_loader.h" 7 #include "chrome/browser/extensions/component_loader.h"
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 scoped_ptr<DictionaryValue> manifest; 134 scoped_ptr<DictionaryValue> manifest;
135 135
136 // Test invalid JSON. 136 // Test invalid JSON.
137 manifest.reset( 137 manifest.reset(
138 component_loader_.ParseManifest("{ 'test': 3 } invalid")); 138 component_loader_.ParseManifest("{ 'test': 3 } invalid"));
139 EXPECT_FALSE(manifest.get()); 139 EXPECT_FALSE(manifest.get());
140 140
141 // Test manifests that are valid JSON, but don't have an object literal 141 // Test manifests that are valid JSON, but don't have an object literal
142 // at the root. ParseManifest() should always return NULL. 142 // at the root. ParseManifest() should always return NULL.
143 143
144 manifest.reset(component_loader_.ParseManifest("")); 144 manifest.reset(component_loader_.ParseManifest(std::string()));
145 EXPECT_FALSE(manifest.get()); 145 EXPECT_FALSE(manifest.get());
146 146
147 manifest.reset(component_loader_.ParseManifest("[{ \"foo\": 3 }]")); 147 manifest.reset(component_loader_.ParseManifest("[{ \"foo\": 3 }]"));
148 EXPECT_FALSE(manifest.get()); 148 EXPECT_FALSE(manifest.get());
149 149
150 manifest.reset(component_loader_.ParseManifest("\"Test\"")); 150 manifest.reset(component_loader_.ParseManifest("\"Test\""));
151 EXPECT_FALSE(manifest.get()); 151 EXPECT_FALSE(manifest.get());
152 152
153 manifest.reset(component_loader_.ParseManifest("42")); 153 manifest.reset(component_loader_.ParseManifest("42"));
154 EXPECT_FALSE(manifest.get()); 154 EXPECT_FALSE(manifest.get());
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); 311 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size());
312 EXPECT_EQ(0u, extension_service_.unloaded_count()); 312 EXPECT_EQ(0u, extension_service_.unloaded_count());
313 313
314 // replace loaded component extension. 314 // replace loaded component extension.
315 component_loader_.AddOrReplace(known_extension); 315 component_loader_.AddOrReplace(known_extension);
316 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); 316 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size());
317 EXPECT_EQ(1u, extension_service_.unloaded_count()); 317 EXPECT_EQ(1u, extension_service_.unloaded_count());
318 } 318 }
319 319
320 } // namespace extensions 320 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_loader.cc ('k') | chrome/browser/extensions/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698