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

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

Issue 2820823005: Revert of Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: 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 base::MakeUnique<base::DictionaryValue>()); 330 new base::DictionaryValue());
331 auto scripts = base::MakeUnique<base::ListValue>(); 331 base::ListValue* scripts = new 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, 334 extensions::manifest_keys::kPlatformAppBackgroundScripts, scripts);
335 std::move(scripts));
336 335
337 extensions::TestExtensionSystem* extension_system( 336 extensions::TestExtensionSystem* extension_system(
338 static_cast<extensions::TestExtensionSystem*>( 337 static_cast<extensions::TestExtensionSystem*>(
339 extensions::ExtensionSystem::Get(profile()))); 338 extensions::ExtensionSystem::Get(profile())));
340 extension_service_ = extension_system->CreateExtensionService( 339 extension_service_ = extension_system->CreateExtensionService(
341 base::CommandLine::ForCurrentProcess(), base::FilePath(), false); 340 base::CommandLine::ForCurrentProcess(), base::FilePath(), false);
342 extension_service_->Init(); 341 extension_service_->Init();
343 342
344 if (auto_start_arc_test_) 343 if (auto_start_arc_test_)
345 arc_test_.SetUp(profile()); 344 arc_test_.SetUp(profile());
(...skipping 19 matching lines...) Expand all
365 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", &error); 364 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", &error);
366 // Fake gmail extension. 365 // Fake gmail extension.
367 base::DictionaryValue manifest_gmail; 366 base::DictionaryValue manifest_gmail;
368 manifest_gmail.SetString(extensions::manifest_keys::kName, 367 manifest_gmail.SetString(extensions::manifest_keys::kName,
369 "Gmail launcher controller test extension"); 368 "Gmail launcher controller test extension");
370 manifest_gmail.SetString(extensions::manifest_keys::kVersion, "1"); 369 manifest_gmail.SetString(extensions::manifest_keys::kVersion, "1");
371 manifest_gmail.SetString(extensions::manifest_keys::kDescription, 370 manifest_gmail.SetString(extensions::manifest_keys::kDescription,
372 "for testing pinned Gmail"); 371 "for testing pinned Gmail");
373 manifest_gmail.SetString(extensions::manifest_keys::kLaunchWebURL, 372 manifest_gmail.SetString(extensions::manifest_keys::kLaunchWebURL,
374 kGmailLaunchURL); 373 kGmailLaunchURL);
375 auto list = base::MakeUnique<base::ListValue>(); 374 base::ListValue* list = new base::ListValue();
376 list->AppendString("*://mail.google.com/mail/ca"); 375 list->AppendString("*://mail.google.com/mail/ca");
377 manifest_gmail.Set(extensions::manifest_keys::kWebURLs, std::move(list)); 376 manifest_gmail.Set(extensions::manifest_keys::kWebURLs, list);
378 377
379 extension3_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, 378 extension3_ = Extension::Create(base::FilePath(), Manifest::UNPACKED,
380 manifest_gmail, Extension::NO_FLAGS, 379 manifest_gmail, Extension::NO_FLAGS,
381 extension_misc::kGmailAppId, &error); 380 extension_misc::kGmailAppId, &error);
382 381
383 // Fake google docs extension. 382 // Fake google docs extension.
384 extension4_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, 383 extension4_ = Extension::Create(base::FilePath(), Manifest::UNPACKED,
385 manifest, Extension::NO_FLAGS, 384 manifest, Extension::NO_FLAGS,
386 extension_misc::kGoogleDocAppId, &error); 385 extension_misc::kGoogleDocAppId, &error);
387 extension5_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, 386 extension5_ = Extension::Create(base::FilePath(), Manifest::UNPACKED,
(...skipping 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after
4287 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4286 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4288 shelf_controller->auto_hide()); 4287 shelf_controller->auto_hide());
4289 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4288 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4290 4289
4291 PrefService* prefs = profile()->GetTestingPrefService(); 4290 PrefService* prefs = profile()->GetTestingPrefService();
4292 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4291 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4293 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4292 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4294 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4293 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4295 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4294 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4296 } 4295 }
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