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

Side by Side Diff: chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
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 "chrome/browser/ui/app_list/extension_app_model_builder.h" 5 #include "chrome/browser/ui/app_list/extension_app_model_builder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 TEST_F(ExtensionAppModelBuilderTest, InvalidOrdinal) { 266 TEST_F(ExtensionAppModelBuilderTest, InvalidOrdinal) {
267 // Creates a no-ordinal case. 267 // Creates a no-ordinal case.
268 AppSorting* sorting = ExtensionSystem::Get(profile_.get())->app_sorting(); 268 AppSorting* sorting = ExtensionSystem::Get(profile_.get())->app_sorting();
269 sorting->ClearOrdinals(kPackagedApp1Id); 269 sorting->ClearOrdinals(kPackagedApp1Id);
270 270
271 // Creates a corrupted ordinal case. 271 // Creates a corrupted ordinal case.
272 extensions::ExtensionScopedPrefs* scoped_prefs = 272 extensions::ExtensionScopedPrefs* scoped_prefs =
273 extensions::ExtensionPrefs::Get(profile_.get()); 273 extensions::ExtensionPrefs::Get(profile_.get());
274 scoped_prefs->UpdateExtensionPref( 274 scoped_prefs->UpdateExtensionPref(kHostedAppId, "page_ordinal",
275 kHostedAppId, 275 new base::Value("a corrupted ordinal"));
276 "page_ordinal",
277 new base::StringValue("a corrupted ordinal"));
278 276
279 // This should not assert or crash. 277 // This should not assert or crash.
280 CreateBuilder(); 278 CreateBuilder();
281 } 279 }
282 280
283 TEST_F(ExtensionAppModelBuilderTest, OrdinalConfilicts) { 281 TEST_F(ExtensionAppModelBuilderTest, OrdinalConfilicts) {
284 // Creates conflict ordinals for app1 and app2. 282 // Creates conflict ordinals for app1 and app2.
285 syncer::StringOrdinal conflict_ordinal = 283 syncer::StringOrdinal conflict_ordinal =
286 syncer::StringOrdinal::CreateInitialOrdinal(); 284 syncer::StringOrdinal::CreateInitialOrdinal();
287 285
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 extensions::Extension::WAS_INSTALLED_BY_DEFAULT | 320 extensions::Extension::WAS_INSTALLED_BY_DEFAULT |
323 extensions::Extension::FROM_BOOKMARK, 321 extensions::Extension::FROM_BOOKMARK,
324 kAppId, 322 kAppId,
325 &err); 323 &err);
326 EXPECT_TRUE(err.empty()); 324 EXPECT_TRUE(err.empty());
327 325
328 service_->AddExtension(bookmark_app.get()); 326 service_->AddExtension(bookmark_app.get());
329 EXPECT_EQ(kDefaultAppCount + 1, model_->top_level_item_list()->item_count()); 327 EXPECT_EQ(kDefaultAppCount + 1, model_->top_level_item_list()->item_count());
330 EXPECT_NE(std::string::npos, GetModelContent(model_.get()).find(kAppName)); 328 EXPECT_NE(std::string::npos, GetModelContent(model_.get()).find(kAppName));
331 } 329 }
OLDNEW
« no previous file with comments | « chrome/browser/task_profiler/task_profiler_data_serializer.cc ('k') | chrome/browser/ui/app_list/start_page_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698