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

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

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: We have both kinds of compile fixes: mac and windows Created 3 years, 10 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 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 native_window_.reset(new aura::Window(NULL)); 988 native_window_.reset(new aura::Window(NULL));
989 native_window_->set_id(0); 989 native_window_->set_id(0);
990 native_window_->SetType(ui::wm::WINDOW_TYPE_POPUP); 990 native_window_->SetType(ui::wm::WINDOW_TYPE_POPUP);
991 native_window_->Init(ui::LAYER_TEXTURED); 991 native_window_->Init(ui::LAYER_TEXTURED);
992 native_window_->Show(); 992 native_window_->Show();
993 aura::client::ParentWindowWithContext(native_window_.get(), 993 aura::client::ParentWindowWithContext(native_window_.get(),
994 ash::Shell::GetPrimaryRootWindow(), 994 ash::Shell::GetPrimaryRootWindow(),
995 gfx::Rect(10, 10, 20, 30)); 995 gfx::Rect(10, 10, 20, 30));
996 Browser::CreateParams params = Browser::CreateParams::CreateForApp( 996 Browser::CreateParams params = Browser::CreateParams::CreateForApp(
997 kCrxAppPrefix + app_name, true /* trusted_source */, gfx::Rect(), 997 kCrxAppPrefix + app_name, true /* trusted_source */, gfx::Rect(),
998 profile); 998 profile, true);
999 params.window = this; 999 params.window = this;
1000 browser_.reset(new Browser(params)); 1000 browser_.reset(new Browser(params));
1001 chrome::AddTabAt(browser_.get(), GURL(), 0, true); 1001 chrome::AddTabAt(browser_.get(), GURL(), 0, true);
1002 } 1002 }
1003 1003
1004 ~V1App() override { 1004 ~V1App() override {
1005 // close all tabs. Note that we do not need to destroy the browser itself. 1005 // close all tabs. Note that we do not need to destroy the browser itself.
1006 browser_->tab_strip_model()->CloseAllTabs(); 1006 browser_->tab_strip_model()->CloseAllTabs();
1007 } 1007 }
1008 1008
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 2307
2308 // Create a second test profile. The first is the one in profile() created in 2308 // Create a second test profile. The first is the one in profile() created in
2309 // BrowserWithTestWindowTest::SetUp(). 2309 // BrowserWithTestWindowTest::SetUp().
2310 // No need to add the profiles to the MultiUserWindowManager here. 2310 // No need to add the profiles to the MultiUserWindowManager here.
2311 // CreateMultiUserProfile() already does that. 2311 // CreateMultiUserProfile() already does that.
2312 TestingProfile* profile2 = CreateMultiUserProfile("user2"); 2312 TestingProfile* profile2 = CreateMultiUserProfile("user2");
2313 const AccountId current_user = 2313 const AccountId current_user =
2314 multi_user_util::GetAccountIdFromProfile(profile()); 2314 multi_user_util::GetAccountIdFromProfile(profile());
2315 2315
2316 // Create a browser window with a native window for the current user. 2316 // Create a browser window with a native window for the current user.
2317 Browser::CreateParams params(profile()); 2317 Browser::CreateParams params(profile(), true);
2318 std::unique_ptr<Browser> browser( 2318 std::unique_ptr<Browser> browser(
2319 chrome::CreateBrowserWithAuraTestWindowForParams(nullptr, &params)); 2319 chrome::CreateBrowserWithAuraTestWindowForParams(nullptr, &params));
2320 BrowserWindow* browser_window = browser->window(); 2320 BrowserWindow* browser_window = browser->window();
2321 aura::Window* window = browser_window->GetNativeWindow(); 2321 aura::Window* window = browser_window->GetNativeWindow();
2322 manager->SetWindowOwner(window, current_user); 2322 manager->SetWindowOwner(window, current_user);
2323 2323
2324 // Check that an activation of the window on its owner's desktop does not 2324 // Check that an activation of the window on its owner's desktop does not
2325 // change the visibility to another user. 2325 // change the visibility to another user.
2326 launcher_controller_->ActivateWindowOrMinimizeIfActive(browser_window, false); 2326 launcher_controller_->ActivateWindowOrMinimizeIfActive(browser_window, false);
2327 EXPECT_TRUE(manager->IsWindowOnDesktopOfUser(window, current_user)); 2327 EXPECT_TRUE(manager->IsWindowOnDesktopOfUser(window, current_user));
(...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after
4211 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4211 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4212 shelf_controller->auto_hide()); 4212 shelf_controller->auto_hide());
4213 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4213 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4214 4214
4215 PrefService* prefs = profile()->GetTestingPrefService(); 4215 PrefService* prefs = profile()->GetTestingPrefService();
4216 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4216 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4217 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4217 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4218 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4218 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4219 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4219 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4220 } 4220 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698