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

Side by Side Diff: chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 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/sync/profile_signin_confirmation_helper.h" 5 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 extensions->AddExtension(extension.get()); 221 extensions->AddExtension(extension.get());
222 EXPECT_TRUE(GetCallbackResult( 222 EXPECT_TRUE(GetCallbackResult(
223 base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get()))); 223 base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get())));
224 } 224 }
225 #endif 225 #endif
226 226
227 // http://crbug.com/393149 227 // http://crbug.com/393149
228 TEST_F(ProfileSigninConfirmationHelperTest, 228 TEST_F(ProfileSigninConfirmationHelperTest,
229 DISABLED_PromptForNewProfile_History) { 229 DISABLED_PromptForNewProfile_History) {
230 HistoryService* history = HistoryServiceFactory::GetForProfile( 230 HistoryService* history = HistoryServiceFactory::GetForProfile(
231 profile_.get(), 231 profile_.get(), ServiceAccessType::EXPLICIT_ACCESS);
232 Profile::EXPLICIT_ACCESS);
233 ASSERT_TRUE(history); 232 ASSERT_TRUE(history);
234 233
235 // Profile is new but has more than $(kHistoryEntriesBeforeNewProfilePrompt) 234 // Profile is new but has more than $(kHistoryEntriesBeforeNewProfilePrompt)
236 // history items. 235 // history items.
237 char buf[18]; 236 char buf[18];
238 for (int i = 0; i < 10; i++) { 237 for (int i = 0; i < 10; i++) {
239 base::snprintf(buf, arraysize(buf), "http://foo.com/%d", i); 238 base::snprintf(buf, arraysize(buf), "http://foo.com/%d", i);
240 history->AddPage( 239 history->AddPage(
241 GURL(std::string(buf)), base::Time::Now(), NULL, 1, 240 GURL(std::string(buf)), base::Time::Now(), NULL, 1,
242 GURL(), history::RedirectList(), ui::PAGE_TRANSITION_LINK, 241 GURL(), history::RedirectList(), ui::PAGE_TRANSITION_LINK,
243 history::SOURCE_BROWSED, false); 242 history::SOURCE_BROWSED, false);
244 } 243 }
245 EXPECT_TRUE( 244 EXPECT_TRUE(
246 GetCallbackResult( 245 GetCallbackResult(
247 base::Bind( 246 base::Bind(
248 &ui::CheckShouldPromptForNewProfile, 247 &ui::CheckShouldPromptForNewProfile,
249 profile_.get()))); 248 profile_.get())));
250 } 249 }
251 250
252 // http://crbug.com/393149 251 // http://crbug.com/393149
253 TEST_F(ProfileSigninConfirmationHelperTest, 252 TEST_F(ProfileSigninConfirmationHelperTest,
254 DISABLED_PromptForNewProfile_TypedURLs) { 253 DISABLED_PromptForNewProfile_TypedURLs) {
255 HistoryService* history = HistoryServiceFactory::GetForProfile( 254 HistoryService* history = HistoryServiceFactory::GetForProfile(
256 profile_.get(), 255 profile_.get(), ServiceAccessType::EXPLICIT_ACCESS);
257 Profile::EXPLICIT_ACCESS);
258 ASSERT_TRUE(history); 256 ASSERT_TRUE(history);
259 257
260 // Profile is new but has a typed URL. 258 // Profile is new but has a typed URL.
261 history->AddPage( 259 history->AddPage(
262 GURL("http://example.com"), base::Time::Now(), NULL, 1, 260 GURL("http://example.com"), base::Time::Now(), NULL, 1,
263 GURL(), history::RedirectList(), ui::PAGE_TRANSITION_TYPED, 261 GURL(), history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
264 history::SOURCE_BROWSED, false); 262 history::SOURCE_BROWSED, false);
265 EXPECT_TRUE( 263 EXPECT_TRUE(
266 GetCallbackResult( 264 GetCallbackResult(
267 base::Bind( 265 base::Bind(
268 &ui::CheckShouldPromptForNewProfile, 266 &ui::CheckShouldPromptForNewProfile,
269 profile_.get()))); 267 profile_.get())));
270 } 268 }
271 269
272 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) { 270 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) {
273 // Browser has been shut down since profile was created. 271 // Browser has been shut down since profile was created.
274 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE); 272 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE);
275 EXPECT_TRUE( 273 EXPECT_TRUE(
276 GetCallbackResult( 274 GetCallbackResult(
277 base::Bind( 275 base::Bind(
278 &ui::CheckShouldPromptForNewProfile, 276 &ui::CheckShouldPromptForNewProfile,
279 profile_.get()))); 277 profile_.get())));
280 } 278 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.cc ('k') | chrome/browser/ui/toolbar/back_forward_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698