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

Unified Diff: chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc

Issue 10961027: cros: Fix crash in AppNonClientFrameViewAura::ControlView::ButtonPressed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review feedback Created 8 years, 3 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/views/frame/app_non_client_frame_view_aura.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/views/frame/app_non_client_frame_view_aura_browsertest.cc
diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
index ec4ef5ea09526a1b513cc9b218e628ce0fd3d19d..46de1bf2b7cb310acf0e5250eda3dfb8dcd69ff5 100644
--- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
+++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
@@ -16,6 +16,21 @@
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window.h"
+using aura::Window;
+
+namespace {
+
+bool HasChildWindowNamed(Window* window, const char* name) {
+ for (size_t i = 0; i < window->children().size(); ++i) {
+ Window* child = window->children()[i];
+ if (child->name() == name)
+ return true;
+ }
+ return false;
+}
+
+} // namespace
+
class AppNonClientFrameViewAuraTest : public InProcessBrowserTest {
public:
AppNonClientFrameViewAuraTest() : InProcessBrowserTest(), app_browser_(NULL) {
@@ -94,3 +109,23 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, KeyboardClose) {
// App browser is closed.
EXPECT_EQ(1u, browser::GetBrowserCount(browser()->profile()));
}
+
+// Ensure that snapping left with Alt-[ closes the control window.
+IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, SnapLeftClosesControls) {
+ aura::RootWindow* root_window = GetRootWindow();
+ aura::test::EventGenerator eg(root_window);
+ aura::Window* native_window = app_browser()->window()->GetNativeWindow();
+
+ // Control window exists.
+ EXPECT_TRUE(HasChildWindowNamed(
+ native_window, AppNonClientFrameViewAura::kControlWindowName));
+
+ // Send Alt-[
+ eg.PressKey(ui::VKEY_OEM_4, ui::EF_ALT_DOWN);
+ eg.ReleaseKey(ui::VKEY_OEM_4, ui::EF_ALT_DOWN);
+ content::RunAllPendingInMessageLoop();
+
+ // Control window is gone.
+ EXPECT_FALSE(HasChildWindowNamed(
+ native_window, AppNonClientFrameViewAura::kControlWindowName));
+}
« no previous file with comments | « chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698