| 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 ff365d4f98b2c78200ceb69eaf8c4e087a715e21..59e46551ee5e8186d6a2d29e9030995ae016f0e7 100644
|
| --- a/ui/views/window/dialog_delegate_unittest.cc
|
| +++ b/ui/views/window/dialog_delegate_unittest.cc
|
| @@ -66,6 +66,7 @@ class TestDialog : public DialogDelegateView {
|
| base::string16 GetWindowTitle() const override { return title_; }
|
| View* GetInitiallyFocusedView() override { return input_; }
|
| bool ShouldUseCustomFrame() const override { return true; }
|
| + int GetDialogButtons() const override { return dialog_buttons_; }
|
|
|
| void CheckAndResetStates(bool canceled,
|
| bool accepted,
|
| @@ -90,6 +91,9 @@ class TestDialog : public DialogDelegateView {
|
| void set_should_handle_escape(bool should_handle_escape) {
|
| should_handle_escape_ = should_handle_escape;
|
| }
|
| + void set_dialog_buttons(int dialog_buttons) {
|
| + dialog_buttons_ = dialog_buttons;
|
| + }
|
|
|
| views::Textfield* input() { return input_; }
|
|
|
| @@ -103,6 +107,7 @@ class TestDialog : public DialogDelegateView {
|
| base::string16 title_;
|
| bool show_close_button_ = true;
|
| bool should_handle_escape_ = false;
|
| + int dialog_buttons_ = ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TestDialog);
|
| };
|
| @@ -382,4 +387,11 @@ TEST_F(DialogTest, UnfocusableInitialFocus) {
|
| dialog_widget->CloseNow();
|
| }
|
|
|
| +TEST_F(DialogTest, DontSnapWithoutButtons) {
|
| + TestDialog dialog;
|
| + EXPECT_TRUE(dialog.ShouldSnapFrameWidth());
|
| + dialog.set_dialog_buttons(ui::DIALOG_BUTTON_NONE);
|
| + EXPECT_FALSE(dialog.ShouldSnapFrameWidth());
|
| +}
|
| +
|
| } // namespace views
|
|
|