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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble Created 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/ui/ash/launcher/chrome_launcher_controller_impl.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 "for testing pinned apps"); 320 "for testing pinned apps");
321 321
322 base::DictionaryValue manifest_platform_app; 322 base::DictionaryValue manifest_platform_app;
323 manifest_platform_app.SetString(extensions::manifest_keys::kName, 323 manifest_platform_app.SetString(extensions::manifest_keys::kName,
324 "launcher controller test platform app"); 324 "launcher controller test platform app");
325 manifest_platform_app.SetString(extensions::manifest_keys::kVersion, "1"); 325 manifest_platform_app.SetString(extensions::manifest_keys::kVersion, "1");
326 manifest_platform_app.SetString(extensions::manifest_keys::kDescription, 326 manifest_platform_app.SetString(extensions::manifest_keys::kDescription,
327 "for testing pinned platform apps"); 327 "for testing pinned platform apps");
328 manifest_platform_app.SetString(extensions::manifest_keys::kApp, "true"); 328 manifest_platform_app.SetString(extensions::manifest_keys::kApp, "true");
329 manifest_platform_app.Set(extensions::manifest_keys::kPlatformAppBackground, 329 manifest_platform_app.Set(extensions::manifest_keys::kPlatformAppBackground,
330 new base::DictionaryValue()); 330 base::MakeUnique<base::DictionaryValue>());
331 base::ListValue* scripts = new base::ListValue(); 331 auto scripts = base::MakeUnique<base::ListValue>();
332 scripts->AppendString("main.js"); 332 scripts->AppendString("main.js");
333 manifest_platform_app.Set( 333 manifest_platform_app.Set(
334 extensions::manifest_keys::kPlatformAppBackgroundScripts, scripts); 334 extensions::manifest_keys::kPlatformAppBackgroundScripts,
335 std::move(scripts));
335 336
336 extensions::TestExtensionSystem* extension_system( 337 extensions::TestExtensionSystem* extension_system(
337 static_cast<extensions::TestExtensionSystem*>( 338 static_cast<extensions::TestExtensionSystem*>(
338 extensions::ExtensionSystem::Get(profile()))); 339 extensions::ExtensionSystem::Get(profile())));
339 extension_service_ = extension_system->CreateExtensionService( 340 extension_service_ = extension_system->CreateExtensionService(
340 base::CommandLine::ForCurrentProcess(), base::FilePath(), false); 341 base::CommandLine::ForCurrentProcess(), base::FilePath(), false);
341 extension_service_->Init(); 342 extension_service_->Init();
342 343
343 if (auto_start_arc_test_) 344 if (auto_start_arc_test_)
344 arc_test_.SetUp(profile()); 345 arc_test_.SetUp(profile());
(...skipping 19 matching lines...) Expand all
364 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", &error); 365 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", &error);
365 // Fake gmail extension. 366 // Fake gmail extension.
366 base::DictionaryValue manifest_gmail; 367 base::DictionaryValue manifest_gmail;
367 manifest_gmail.SetString(extensions::manifest_keys::kName, 368 manifest_gmail.SetString(extensions::manifest_keys::kName,
368 "Gmail launcher controller test extension"); 369 "Gmail launcher controller test extension");
369 manifest_gmail.SetString(extensions::manifest_keys::kVersion, "1"); 370 manifest_gmail.SetString(extensions::manifest_keys::kVersion, "1");
370 manifest_gmail.SetString(extensions::manifest_keys::kDescription, 371 manifest_gmail.SetString(extensions::manifest_keys::kDescription,
371 "for testing pinned Gmail"); 372 "for testing pinned Gmail");
372 manifest_gmail.SetString(extensions::manifest_keys::kLaunchWebURL, 373 manifest_gmail.SetString(extensions::manifest_keys::kLaunchWebURL,
373 kGmailLaunchURL); 374 kGmailLaunchURL);
374 base::ListValue* list = new base::ListValue(); 375 auto list = base::MakeUnique<base::ListValue>();
375 list->AppendString("*://mail.google.com/mail/ca"); 376 list->AppendString("*://mail.google.com/mail/ca");
376 manifest_gmail.Set(extensions::manifest_keys::kWebURLs, list); 377 manifest_gmail.Set(extensions::manifest_keys::kWebURLs, std::move(list));
377 378
378 extension3_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, 379 extension3_ = Extension::Create(base::FilePath(), Manifest::UNPACKED,
379 manifest_gmail, Extension::NO_FLAGS, 380 manifest_gmail, Extension::NO_FLAGS,
380 extension_misc::kGmailAppId, &error); 381 extension_misc::kGmailAppId, &error);
381 382
382 // Fake google docs extension. 383 // Fake google docs extension.
383 extension4_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, 384 extension4_ = Extension::Create(base::FilePath(), Manifest::UNPACKED,
384 manifest, Extension::NO_FLAGS, 385 manifest, Extension::NO_FLAGS,
385 extension_misc::kGoogleDocAppId, &error); 386 extension_misc::kGoogleDocAppId, &error);
386 extension5_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, 387 extension5_ = Extension::Create(base::FilePath(), Manifest::UNPACKED,
(...skipping 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after
4286 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4287 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4287 shelf_controller->auto_hide()); 4288 shelf_controller->auto_hide());
4288 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4289 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4289 4290
4290 PrefService* prefs = profile()->GetTestingPrefService(); 4291 PrefService* prefs = profile()->GetTestingPrefService();
4291 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4292 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4292 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4293 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4293 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4294 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4294 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4295 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4295 } 4296 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.cc ('k') | chrome/browser/ui/browser_window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698