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

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

Issue 16174003: Make all tests use GetActiveDesktop() instead of hardcoding HOST_DESKTOP_TYPE_NATIVE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 (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_destroyer.h" 10 #include "chrome/browser/profiles/profile_destroyer.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 TestingProfile::Builder builder; 294 TestingProfile::Builder builder;
295 TestingProfile* profile2 = builder.Build().release(); 295 TestingProfile* profile2 = builder.Build().release();
296 profile2->set_incognito(true); 296 profile2->set_incognito(true);
297 TestingProfile::Builder builder2; 297 TestingProfile::Builder builder2;
298 TestingProfile* profile1 = builder2.Build().release(); 298 TestingProfile* profile1 = builder2.Build().release();
299 profile2->SetOriginalProfile(profile1); 299 profile2->SetOriginalProfile(profile1);
300 EXPECT_EQ(profile2->GetOriginalProfile(), profile1); 300 EXPECT_EQ(profile2->GetOriginalProfile(), profile1);
301 profile1->SetOffTheRecordProfile(profile2); 301 profile1->SetOffTheRecordProfile(profile2);
302 302
303 // Create a new browser based on the off the record profile. 303 // Create a new browser based on the off the record profile.
304 Browser::CreateParams profile_params(profile2, 304 Browser::CreateParams profile_params(profile2, chrome::GetActiveDesktop());
305 chrome::HOST_DESKTOP_TYPE_NATIVE);
306 scoped_ptr<Browser> browser2( 305 scoped_ptr<Browser> browser2(
307 chrome::CreateBrowserWithTestWindowForParams(&profile_params)); 306 chrome::CreateBrowserWithTestWindowForParams(&profile_params));
308 307
309 ProfileManager* profile_manager = testing_profile_manager.profile_manager(); 308 ProfileManager* profile_manager = testing_profile_manager.profile_manager();
310 chrome::BrowserCommandController* command_controller = 309 chrome::BrowserCommandController* command_controller =
311 new chrome::BrowserCommandController(browser2.get(), profile_manager); 310 new chrome::BrowserCommandController(browser2.get(), profile_manager);
312 const CommandUpdater* command_updater = command_controller->command_updater(); 311 const CommandUpdater* command_updater = command_controller->command_updater();
313 312
314 // Check that the SYNC_SETUP command is updated on preference change. 313 // Check that the SYNC_SETUP command is updated on preference change.
315 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); 314 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
(...skipping 12 matching lines...) Expand all
328 ProfileManager* profile_manager = testing_profile_manager.profile_manager(); 327 ProfileManager* profile_manager = testing_profile_manager.profile_manager();
329 chrome::BrowserCommandController command_controller(browser(), 328 chrome::BrowserCommandController command_controller(browser(),
330 profile_manager); 329 profile_manager);
331 const CommandUpdater* command_updater = command_controller.command_updater(); 330 const CommandUpdater* command_updater = command_controller.command_updater();
332 331
333 // Check that the SYNC_SETUP command is updated on preference change. 332 // Check that the SYNC_SETUP command is updated on preference change.
334 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); 333 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
335 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); 334 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false);
336 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); 335 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
337 } 336 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_navigator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698