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

Side by Side Diff: ash/root_window_controller_unittest.cc

Issue 29943002: Limit display of the virtual keyboard to state changes triggered from a user gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ash_unittests Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/root_window_controller.h" 5 #include "ash/root_window_controller.h"
6 6
7 #include "ash/session_state_delegate.h" 7 #include "ash/session_state_delegate.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 ClickVirtualKeyboardInBlockedWindow) { 614 ClickVirtualKeyboardInBlockedWindow) {
615 aura::Window* root_window = Shell::GetPrimaryRootWindow(); 615 aura::Window* root_window = Shell::GetPrimaryRootWindow();
616 aura::Window* keyboard_container = Shell::GetContainer(root_window, 616 aura::Window* keyboard_container = Shell::GetContainer(root_window,
617 internal::kShellWindowId_VirtualKeyboardContainer); 617 internal::kShellWindowId_VirtualKeyboardContainer);
618 ASSERT_TRUE(keyboard_container); 618 ASSERT_TRUE(keyboard_container);
619 keyboard_container->Show(); 619 keyboard_container->Show();
620 620
621 aura::Window* keyboard_window = Shell::GetInstance()->keyboard_controller()-> 621 aura::Window* keyboard_window = Shell::GetInstance()->keyboard_controller()->
622 proxy()->GetKeyboardWindow(); 622 proxy()->GetKeyboardWindow();
623 keyboard_container->AddChild(keyboard_window); 623 keyboard_container->AddChild(keyboard_window);
624 keyboard_window->set_owned_by_parent(false);
624 keyboard_window->SetBounds(gfx::Rect()); 625 keyboard_window->SetBounds(gfx::Rect());
625 keyboard_window->Show(); 626 keyboard_window->Show();
626 627
627 aura::test::TestEventHandler* handler = new aura::test::TestEventHandler; 628 aura::test::TestEventHandler* handler = new aura::test::TestEventHandler;
628 root_window->SetEventFilter(handler); 629 root_window->SetEventFilter(handler);
629 630
630 aura::test::EventGenerator event_generator(root_window, keyboard_window); 631 aura::test::EventGenerator event_generator(root_window, keyboard_window);
631 event_generator.ClickLeftButton(); 632 event_generator.ClickLeftButton();
632 int expected_mouse_presses = 1; 633 int expected_mouse_presses = 1;
633 EXPECT_EQ(expected_mouse_presses, handler->num_mouse_events() / 2); 634 EXPECT_EQ(expected_mouse_presses, handler->num_mouse_events() / 2);
(...skipping 22 matching lines...) Expand all
656 aura::WindowTracker tracker; 657 aura::WindowTracker tracker;
657 tracker.Add(keyboard_container); 658 tracker.Add(keyboard_container);
658 // Mock a login user profile change to reinitialize the keyboard. 659 // Mock a login user profile change to reinitialize the keyboard.
659 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); 660 ash::Shell::GetInstance()->OnLoginUserProfilePrepared();
660 // keyboard_container should no longer be present. 661 // keyboard_container should no longer be present.
661 EXPECT_FALSE(tracker.Contains(keyboard_container)); 662 EXPECT_FALSE(tracker.Contains(keyboard_container));
662 } 663 }
663 664
664 } // namespace test 665 } // namespace test
665 } // namespace ash 666 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698