| Index: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
|
| index 2153b2e733f6d9d79dd161569e08d20fa1e5a216..12ad69478ef18ab5fcb6d5b11b25dc5c7c2d69fa 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
|
| @@ -56,6 +56,7 @@
|
| #include "ui/events/gestures/gesture_configuration.h"
|
| #include "ui/events/test/event_generator.h"
|
| #include "ui/wm/core/default_activation_client.h"
|
| +#include "ui/wm/core/window_util.h"
|
|
|
| using testing::_;
|
|
|
| @@ -845,6 +846,35 @@ TEST_F(RenderWidgetHostViewAuraTest, PopupRetainsCaptureAfterMouseRelease) {
|
| }
|
| #endif
|
|
|
| +// Test that select boxes close when their parent window loses focus (e.g. due
|
| +// to an alert or system modal dialog).
|
| +TEST_F(RenderWidgetHostViewAuraTest, PopupClosesWhenParentLosesFocus) {
|
| + parent_view_->SetBounds(gfx::Rect(10, 10, 400, 400));
|
| + parent_view_->Focus();
|
| + EXPECT_TRUE(parent_view_->HasFocus());
|
| +
|
| + ui::test::EventGenerator generator(
|
| + parent_view_->GetNativeView()->GetRootWindow(), gfx::Point(300, 300));
|
| + generator.PressLeftButton();
|
| +
|
| + view_->SetPopupType(blink::WebPopupTypeSelect);
|
| + view_->InitAsPopup(parent_view_, gfx::Rect(10, 10, 100, 100));
|
| +
|
| + aura::Window* popup_window = view_->GetNativeView();
|
| + TestWindowObserver observer(popup_window);
|
| +
|
| + aura::test::TestWindowDelegate delegate;
|
| + scoped_ptr<aura::Window> dialog_window(new aura::Window(&delegate));
|
| + dialog_window->Init(aura::WINDOW_LAYER_TEXTURED);
|
| + aura::client::ParentWindowWithContext(
|
| + dialog_window.get(), popup_window, gfx::Rect());
|
| + dialog_window->Show();
|
| + wm::ActivateWindow(dialog_window.get());
|
| +
|
| + ASSERT_TRUE(wm::IsActiveWindow(dialog_window.get()));
|
| + EXPECT_TRUE(observer.destroyed());
|
| +}
|
| +
|
| // Checks that IME-composition-event state is maintained correctly.
|
| TEST_F(RenderWidgetHostViewAuraTest, SetCompositionText) {
|
| view_->InitAsChild(NULL);
|
|
|