diff options
author | xdai <xdai@chromium.org> | 2015-02-19 14:27:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-19 22:27:51 +0000 |
commit | 4865e3cf6a847b406e9061d5680dbb143cc88186 (patch) | |
tree | 27e518ad93f21d428f866f37b576eb6976e7e984 /ui/wm | |
parent | a917b3da2302b5c6e1e4860b3a8af58aee13798e (diff) | |
download | chromium_src-4865e3cf6a847b406e9061d5680dbb143cc88186.zip chromium_src-4865e3cf6a847b406e9061d5680dbb143cc88186.tar.gz chromium_src-4865e3cf6a847b406e9061d5680dbb143cc88186.tar.bz2 |
Add TransientChildWindowActivationTest() in focus_controller_unittests.cc.
The parent window's visibility change should not change its transient child's window modality property.
BUG=447743
Review URL: https://codereview.chromium.org/944483002
Cr-Commit-Position: refs/heads/master@{#317148}
Diffstat (limited to 'ui/wm')
-rw-r--r-- | ui/wm/core/focus_controller_unittest.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ui/wm/core/focus_controller_unittest.cc b/ui/wm/core/focus_controller_unittest.cc index a773821..84c691f 100644 --- a/ui/wm/core/focus_controller_unittest.cc +++ b/ui/wm/core/focus_controller_unittest.cc @@ -22,6 +22,7 @@ #include "ui/events/event_handler.h" #include "ui/events/test/event_generator.h" #include "ui/wm/core/base_focus_rules.h" +#include "ui/wm/core/window_util.h" #include "ui/wm/core/wm_state.h" #include "ui/wm/public/activation_change_observer.h" #include "ui/wm/public/activation_client.h" @@ -1111,6 +1112,26 @@ class FocusControllerParentHideTest : public FocusControllerHideTest { public: FocusControllerParentHideTest() : FocusControllerHideTest(true) {} + // The parent window's visibility change should not change its transient child + // window's modality property. + void TransientChildWindowActivationTest() { + aura::Window* w1 = root_window()->GetChildById(1); + aura::Window* w11 = root_window()->GetChildById(11); + ::wm::AddTransientChild(w1, w11); + w11->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); + + EXPECT_EQ(ui::MODAL_TYPE_NONE, w1->GetProperty(aura::client::kModalKey)); + EXPECT_EQ(ui::MODAL_TYPE_WINDOW, w11->GetProperty(aura::client::kModalKey)); + + // Hide the parent window w1 and show it again. + w1->Hide(); + w1->Show(); + + // Test that child window w11 doesn't change its modality property. + EXPECT_EQ(ui::MODAL_TYPE_NONE, w1->GetProperty(aura::client::kModalKey)); + EXPECT_EQ(ui::MODAL_TYPE_WINDOW, w11->GetProperty(aura::client::kModalKey)); + } + private: DISALLOW_COPY_AND_ASSIGN(FocusControllerParentHideTest); }; @@ -1275,6 +1296,10 @@ FOCUS_CONTROLLER_TEST(FocusControllerApiTest, // See description above DontPassDeletedWindow() for details. FOCUS_CONTROLLER_TEST(FocusControllerApiTest, DontPassDeletedWindow); +// See description above TransientChildWindowActivationTest() for details. +FOCUS_CONTROLLER_TEST(FocusControllerParentHideTest, + TransientChildWindowActivationTest); + // - Verifies that the focused text input client is cleard when the window focus // changes. ALL_FOCUS_TESTS(FocusedTextInputClient); |