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

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

Issue 2855623004: Don't allow Checkboxes to participate in equal-sized-buttons in Harmony dialogs. (Closed)
Patch Set: update comment Created 3 years, 8 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 | « ui/views/window/dialog_client_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view_unittest.cc
diff --git a/ui/views/window/dialog_client_view_unittest.cc b/ui/views/window/dialog_client_view_unittest.cc
index a8d3d8d79c222a876312009c96f65ee9328bfbb9..26ef3e303aa8042c0f19363f5e91fb020fb8a08b 100644
--- a/ui/views/window/dialog_client_view_unittest.cc
+++ b/ui/views/window/dialog_client_view_unittest.cc
@@ -9,6 +9,7 @@
#include "build/build_config.h"
#include "ui/base/test/material_design_controller_test_api.h"
#include "ui/base/ui_base_types.h"
+#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/test/test_views.h"
@@ -389,7 +390,7 @@ TEST_F(DialogClientViewTest, LinkedWidths) {
EXPECT_EQ(ok_button_only_width, client_view()->ok_button()->width());
md_test_api.SetSecondaryUiMaterial(true);
- // The extra view should also match, if it's a button.
+ // The extra view should also match, if it's a matching button type.
LabelButton* extra_button = new LabelButton(nullptr, base::string16());
SetExtraView(extra_button);
CheckContentsIsSetToPreferredSize();
@@ -398,6 +399,15 @@ TEST_F(DialogClientViewTest, LinkedWidths) {
// Remove |extra_button| from the View hierarchy so that it can be replaced.
delete extra_button;
+ // Checkbox extends LabelButton, but it should not participate in linking.
+ extra_button = new Checkbox(base::string16());
+ SetExtraView(extra_button);
+ CheckContentsIsSetToPreferredSize();
+ EXPECT_NE(cancel_button_width, extra_button->width());
+
+ // Remove |extra_button| from the View hierarchy so that it can be replaced.
+ delete extra_button;
+
// Non-buttons should always be sized to their preferred size.
View* boring_view = new StaticSizedView(gfx::Size(20, 20));
SetExtraView(boring_view);
« no previous file with comments | « 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