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

Unified Diff: ui/views/window/dialog_delegate_unittest.cc

Issue 1953943003: In dialogs & dialog-like bubbles, make the escape button just close (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 4 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
Index: ui/views/window/dialog_delegate_unittest.cc
diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc
index 86e957ddcb18aefbda65a9bd08e1160ee93543f0..3fc40b9cc8ce87a24f9446bbf87db75a0527d1bf 100644
--- a/ui/views/window/dialog_delegate_unittest.cc
+++ b/ui/views/window/dialog_delegate_unittest.cc
@@ -57,6 +57,9 @@ class TestDialog : public DialogDelegateView, public ButtonListener {
accepted_ = true;
return closeable_;
}
+ bool Close() override {
+ return closeable_;
+ }
// DialogDelegateView overrides:
gfx::Size GetPreferredSize() const override { return gfx::Size(200, 200); }
@@ -146,7 +149,7 @@ TEST_F(DialogTest, AcceptAndCancel) {
LabelButton* ok_button = client_view->ok_button();
LabelButton* cancel_button = client_view->cancel_button();
- // Check that return/escape accelerators accept/cancel dialogs.
+ // Check that return/escape accelerators accept/close dialogs.
EXPECT_EQ(dialog()->input(), dialog()->GetFocusManager()->GetFocusedView());
const ui::KeyEvent return_event(
ui::ET_KEY_PRESSED, ui::VKEY_RETURN, ui::EF_NONE);
@@ -155,7 +158,7 @@ TEST_F(DialogTest, AcceptAndCancel) {
const ui::KeyEvent escape_event(
ui::ET_KEY_PRESSED, ui::VKEY_ESCAPE, ui::EF_NONE);
SimulateKeyEvent(escape_event);
- dialog()->CheckAndResetStates(true, false, nullptr);
+ dialog()->CheckAndResetStates(false, false, nullptr);
msw 2016/05/10 18:23:32 Can you add a test case that Esc closes the dialog
Evan Stade 2016/05/10 19:27:35 Done.
// Check ok and cancel button behavior on a directed return key events.
ok_button->OnKeyPressed(return_event);
« ui/views/window/dialog_client_view.cc ('K') | « ui/views/window/dialog_client_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698