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

Unified Diff: chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc

Issue 2871073002: cros: Bind hangup red button on remote controller to close web dialog (Closed)
Patch Set: nits Created 3 years, 7 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/chromeos/login/ui/login_web_dialog.cc ('k') | chrome/browser/ui/browser_dialogs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc
diff --git a/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc b/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc
index 2ae57edb1cb99e57b0000e486da655add513386c..6a1c8e891bcab46b041795bb4f2649490ae53878 100644
--- a/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc
+++ b/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc
@@ -11,25 +11,37 @@
#include "services/ui/public/interfaces/window_manager_constants.mojom.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
-#include "ui/wm/public/activation_client.h"
+#include "ui/events/test/event_generator.h"
+#include "ui/views/test/widget_test.h"
namespace chromeos {
-typedef InProcessBrowserTest LoginWebDialogTest;
+using LoginWebDialogTest = InProcessBrowserTest;
-// Test that LoginWebDialog is not minimizable.
+// Tests that LoginWebDialog is not minimizable.
IN_PROC_BROWSER_TEST_F(LoginWebDialogTest, CannotMinimize) {
LoginWebDialog* dialog = new LoginWebDialog(
browser()->profile(), nullptr, nullptr, base::string16(), GURL());
dialog->Show();
-
- aura::client::ActivationClient* activation_client =
- aura::client::GetActivationClient(
- ash::Shell::Get()->GetPrimaryRootWindow());
- aura::Window* window = activation_client->GetActiveWindow();
+ aura::Window* window = dialog->get_dialog_window_for_test();
ASSERT_TRUE(window);
EXPECT_EQ(0, window->GetProperty(aura::client::kResizeBehaviorKey) &
ui::mojom::kResizeBehaviorCanMinimize);
}
+// Tests that LoginWebDialog can be closed by 'Shift + BrowserBack' accelerator.
+IN_PROC_BROWSER_TEST_F(LoginWebDialogTest, CloseDialogByAccelerator) {
+ LoginWebDialog* dialog = new LoginWebDialog(
+ browser()->profile(), nullptr, nullptr, base::string16(), GURL());
+ dialog->Show();
+ gfx::NativeWindow window = dialog->get_dialog_window_for_test();
+ ASSERT_TRUE(window);
+ views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
+ views::test::WidgetClosingObserver closing_observer(widget);
+ ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
+ generator.PressKey(ui::VKEY_BROWSER_BACK, ui::EF_SHIFT_DOWN);
+ closing_observer.Wait();
+ EXPECT_TRUE(closing_observer.widget_closed());
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/ui/login_web_dialog.cc ('k') | chrome/browser/ui/browser_dialogs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698