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

Side by Side Diff: chrome/browser/ui/browser_command_controller_unittest.cc

Issue 12610003: Create the testing profile using the builder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove test exclusion. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/unit_tests.gtest-drmemory_win32.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/command_updater.h" 9 #include "chrome/browser/command_updater.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN)); 321 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
322 } 322 }
323 323
324 TEST_F(BrowserCommandControllerTest, 324 TEST_F(BrowserCommandControllerTest,
325 IncognitoModeOnSigninAllowedPrefChange) { 325 IncognitoModeOnSigninAllowedPrefChange) {
326 TestingProfileManager testing_profile_manager( 326 TestingProfileManager testing_profile_manager(
327 TestingBrowserProcess::GetGlobal()); 327 TestingBrowserProcess::GetGlobal());
328 ASSERT_TRUE(testing_profile_manager.SetUp()); 328 ASSERT_TRUE(testing_profile_manager.SetUp());
329 329
330 // Set up a profile with an off the record profile. 330 // Set up a profile with an off the record profile.
331 TestingProfile* profile2 = new TestingProfile(); 331 TestingProfile::Builder builder;
332 TestingProfile* profile2 = builder.Build().release();
sky 2013/03/08 16:08:05 I'm not familiar with TestingPRofile::Builder, who
Adrian Kuegel 2013/03/08 16:28:54 Build() returns a scoped_ptr. So I assume with thi
332 profile2->set_incognito(true); 333 profile2->set_incognito(true);
333 TestingProfile* profile1 = 334 TestingProfile* profile1 =
334 testing_profile_manager.CreateTestingProfile("p1"); 335 testing_profile_manager.CreateTestingProfile("p1");
335 profile2->SetOriginalProfile(profile1); 336 profile2->SetOriginalProfile(profile1);
336 EXPECT_EQ(profile2->GetOriginalProfile(), profile1); 337 EXPECT_EQ(profile2->GetOriginalProfile(), profile1);
337 profile1->SetOffTheRecordProfile(profile2); 338 profile1->SetOffTheRecordProfile(profile2);
338 // Create a new browser based on the off the record profile. 339 // Create a new browser based on the off the record profile.
339 Browser::CreateParams profile_params(profile2, 340 Browser::CreateParams profile_params(profile2,
340 chrome::HOST_DESKTOP_TYPE_NATIVE); 341 chrome::HOST_DESKTOP_TYPE_NATIVE);
341 scoped_ptr<Browser> browser2( 342 scoped_ptr<Browser> browser2(
(...skipping 21 matching lines...) Expand all
363 ProfileManager* profile_manager = testing_profile_manager.profile_manager(); 364 ProfileManager* profile_manager = testing_profile_manager.profile_manager();
364 chrome::BrowserCommandController command_controller(browser(), 365 chrome::BrowserCommandController command_controller(browser(),
365 profile_manager); 366 profile_manager);
366 const CommandUpdater* command_updater = command_controller.command_updater(); 367 const CommandUpdater* command_updater = command_controller.command_updater();
367 368
368 // Check that the SYNC_SETUP command is updated on preference change. 369 // Check that the SYNC_SETUP command is updated on preference change.
369 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); 370 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
370 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); 371 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false);
371 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); 372 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
372 } 373 }
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/unit_tests.gtest-drmemory_win32.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698