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

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

Issue 25034003: Moved apps metro code from apps to chrome/browser/apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix unit test Created 7 years, 2 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 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 "apps/pref_names.h"
6 #include "apps/prefs.h"
7 #include "base/command_line.h" 5 #include "base/command_line.h"
8 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
9 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/pref_registry_simple.h" 8 #include "base/prefs/pref_registry_simple.h"
11 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
12 #include "base/prefs/pref_service_builder.h" 10 #include "base/prefs/pref_service_builder.h"
13 #include "base/prefs/testing_pref_store.h" 11 #include "base/prefs/testing_pref_store.h"
14 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/profiles/profiles_state.h" 13 #include "chrome/browser/profiles/profiles_state.h"
16 #include "chrome/browser/ui/app_list/app_list_service.h" 14 #include "chrome/browser/ui/app_list/app_list_service.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 77
80 void SetupWithCommandLine(const CommandLine& command_line) { 78 void SetupWithCommandLine(const CommandLine& command_line) {
81 user_data_dir_ = base::FilePath(FILE_PATH_LITERAL("udd")); 79 user_data_dir_ = base::FilePath(FILE_PATH_LITERAL("udd"));
82 profile1_.reset( 80 profile1_.reset(
83 new FakeProfile("p1", user_data_dir_.AppendASCII("profile1"))); 81 new FakeProfile("p1", user_data_dir_.AppendASCII("profile1")));
84 profile2_.reset( 82 profile2_.reset(
85 new FakeProfile("p2", user_data_dir_.AppendASCII("profile2"))); 83 new FakeProfile("p2", user_data_dir_.AppendASCII("profile2")));
86 PrefRegistrySimple* pref_registry = new PrefRegistrySimple; 84 PrefRegistrySimple* pref_registry = new PrefRegistrySimple;
87 85
88 AppListService::RegisterPrefs(pref_registry); 86 AppListService::RegisterPrefs(pref_registry);
89 apps::RegisterPrefs(pref_registry);
90 profiles::RegisterPrefs(pref_registry); 87 profiles::RegisterPrefs(pref_registry);
91 88
92 PrefServiceBuilder builder; 89 PrefServiceBuilder builder;
93 builder.WithUserPrefs(new TestingPrefStore); 90 builder.WithUserPrefs(new TestingPrefStore);
94 local_state_.reset(builder.Create(pref_registry)); 91 local_state_.reset(builder.Create(pref_registry));
95 92
96 keep_alive_service_ = new FakeKeepAliveService; 93 keep_alive_service_ = new FakeKeepAliveService;
97 profile_store_ = new FakeProfileStore(user_data_dir_); 94 profile_store_ = new FakeProfileStore(user_data_dir_);
98 service_.reset(new TestingAppListServiceImpl( 95 service_.reset(new TestingAppListServiceImpl(
99 command_line, 96 command_line,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 EXPECT_TRUE(local_state_->GetBoolean(prefs::kAppLauncherHasBeenEnabled)); 166 EXPECT_TRUE(local_state_->GetBoolean(prefs::kAppLauncherHasBeenEnabled));
170 } 167 }
171 168
172 TEST_F(AppListServiceUnitTest, DisableViaCommandLineFlag) { 169 TEST_F(AppListServiceUnitTest, DisableViaCommandLineFlag) {
173 CommandLine command_line(CommandLine::NO_PROGRAM); 170 CommandLine command_line(CommandLine::NO_PROGRAM);
174 command_line.AppendSwitch(switches::kDisableAppList); 171 command_line.AppendSwitch(switches::kDisableAppList);
175 SetupWithCommandLine(command_line); 172 SetupWithCommandLine(command_line);
176 service_->HandleCommandLineFlags(profile1_.get()); 173 service_->HandleCommandLineFlags(profile1_.get());
177 EXPECT_FALSE(local_state_->GetBoolean(prefs::kAppLauncherHasBeenEnabled)); 174 EXPECT_FALSE(local_state_->GetBoolean(prefs::kAppLauncherHasBeenEnabled));
178 } 175 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/ui/apps/app_metro_infobar_delegate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698