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

Unified Diff: chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc

Issue 2273103003: [ash-md] Cancels overview mode before switching user profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Cancels overview mode before switching user profiles (test) Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/multi_user/user_switch_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc
diff --git a/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc b/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc
index 4e8fba931f777413152ac5bbbeb3036726f61b8f..063dbc76426ea46d27223a5d3970b1023000944e 100644
--- a/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc
+++ b/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc
@@ -4,8 +4,11 @@
#include "ash/common/system/chromeos/screen_security/screen_tray_item.h"
#include "ash/common/system/tray/system_tray.h"
+#include "ash/common/wm/overview/window_selector_controller.h"
+#include "ash/common/wm_shell.h"
#include "ash/test/ash_test_base.h"
#include "chrome/browser/ui/ash/multi_user/user_switch_util.h"
+#include "ui/aura/window.h"
namespace ash {
@@ -83,6 +86,13 @@ class TrySwitchingUserTest : public ash::test::AshTestBase {
// Called when the user will get actually switched.
void SwitchCallback() { switch_callback_hit_count_++; }
+ // Methods needed to test with overview mode.
+ WindowSelectorController* window_selector_controller() {
+ return WmShell::Get()->window_selector_controller();
+ }
+ void ToggleOverview() { window_selector_controller()->ToggleOverview(); }
+ bool IsSelecting() { return window_selector_controller()->IsSelecting(); }
oshima 2016/08/25 21:29:39 nit: const?
varkha 2016/08/26 03:28:53 Done.
+
// Various counter accessors.
int stop_capture_callback_hit_count() const {
return stop_capture_callback_hit_count_;
@@ -211,4 +221,16 @@ TEST_F(TrySwitchingUserTest, BothActiveAccepted) {
EXPECT_EQ(1, stop_share_callback_hit_count());
}
+// Test that overview mode is dismissed before switching user profile.
+TEST_F(TrySwitchingUserTest, OverviewModeDismissed) {
+ EXPECT_EQ(0, switch_callback_hit_count());
+ gfx::Rect bounds(0, 0, 100, 100);
+ std::unique_ptr<aura::Window> w(CreateTestWindowInShellWithBounds(bounds));
+ ToggleOverview();
+ ASSERT_TRUE(IsSelecting());
+ SwitchUser(TrySwitchingUserTest::NO_DIALOG);
+ ASSERT_FALSE(IsSelecting());
+ EXPECT_EQ(1, switch_callback_hit_count());
+}
+
} // namespace ash
« no previous file with comments | « chrome/browser/ui/ash/multi_user/user_switch_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698