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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 1228213003: Just set borders once when creating a views::LabelButton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix BookmarkBarViewTest and GlobalErrorServiceBrowserTest Created 5 years, 5 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: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index 3262df593f0a94ce6001257517e0d9e28ec48769..19dd3ebd7c1db5090fb8fe9aab80c44b6a77088a 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -287,6 +287,10 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase {
AddTestData(CreateBigMenu());
+ // Create the Widget. This ensures the following calculation correctly
msw 2015/07/10 18:40:07 Hmm, where does the view get added to the widget?
tapted 2015/07/13 07:41:21 Yeah, this test harness is a bit crafty :). ViewEv
+ // applies borders which may be derived from the Widget's NativeTheme.
+ ViewEventTestBase::SetUp();
msw 2015/07/10 18:40:07 nit: maybe call this at the top of the function?
tapted 2015/07/13 07:41:21 (see above)
+
// Calculate the preferred size so that one button doesn't fit, which
// triggers the overflow button to appear. We have to do this incrementally
// as there isn't a good way to determine the point at which the overflow
@@ -302,8 +306,7 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase {
bb_view_->SetBounds(0, 0, bb_view_pref_.width(), bb_view_pref_.height());
bb_view_->Layout();
} while (GetBookmarkButton(6)->visible());
-
- ViewEventTestBase::SetUp();
+ window_->SetSize(GetPreferredSize());
msw 2015/07/10 18:40:07 why is this needed now?
tapted 2015/07/13 07:41:22 (tl;dr "moved" this to the GetPreferredSize() test
}
void TearDown() override {
« no previous file with comments | « no previous file | chrome/browser/ui/views/global_error_bubble_view.cc » ('j') | ui/views/controls/button/blue_button_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698