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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 2661313005: Add extra DCHECKing to try to catch subpixel rendering on a non-opaque (Closed)
Patch Set: sadrul review Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | ui/views/controls/label.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 Browser::CreateParams native_params(profile_.get()); 295 Browser::CreateParams native_params(profile_.get());
296 browser_ = chrome::CreateBrowserWithTestWindowForParams(&native_params); 296 browser_ = chrome::CreateBrowserWithTestWindowForParams(&native_params);
297 297
298 local_state_.reset(new ScopedTestingLocalState( 298 local_state_.reset(new ScopedTestingLocalState(
299 TestingBrowserProcess::GetGlobal())); 299 TestingBrowserProcess::GetGlobal()));
300 model_->ClearStore(); 300 model_->ClearStore();
301 301
302 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL)); 302 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL));
303 bb_view_->set_owned_by_client(); 303 bb_view_->set_owned_by_client();
304 // Real bookmark bars get a BookmarkBarViewBackground. Set a non-null
msw 2017/02/11 00:49:37 optional nit: s/a non-null/an opaque/?
Evan Stade 2017/02/11 01:42:37 Done.
305 // background here just to avoid triggering subpixel rendering issues.
306 bb_view_->set_background(
307 views::Background::CreateSolidBackground(SK_ColorWHITE));
304 bb_view_->SetPageNavigator(&navigator_); 308 bb_view_->SetPageNavigator(&navigator_);
305 309
306 AddTestData(CreateBigMenu()); 310 AddTestData(CreateBigMenu());
307 311
308 // Create the Widget. Note the initial size is given by GetPreferredSize() 312 // Create the Widget. Note the initial size is given by GetPreferredSize()
309 // during initialization. This occurs after the WidgetDelegate provides 313 // during initialization. This occurs after the WidgetDelegate provides
310 // |bb_view_| as the contents view and adds it to the hierarchy. 314 // |bb_view_| as the contents view and adds it to the hierarchy.
311 ViewEventTestBase::SetUp(); 315 ViewEventTestBase::SetUp();
312 316
313 // Verify the layout triggered by the initial size preserves the overflow 317 // Verify the layout triggered by the initial size preserves the overflow
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 ASSERT_EQ(2u, navigator_.urls().size()); 2377 ASSERT_EQ(2u, navigator_.urls().size());
2374 EXPECT_EQ(navigator_.urls()[0], 2378 EXPECT_EQ(navigator_.urls()[0],
2375 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url()); 2379 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url());
2376 EXPECT_EQ(navigator_.urls()[1], 2380 EXPECT_EQ(navigator_.urls()[1],
2377 model_->bookmark_bar_node()->GetChild(0)->GetChild(2)->url()); 2381 model_->bookmark_bar_node()->GetChild(0)->GetChild(2)->url());
2378 Done(); 2382 Done();
2379 } 2383 }
2380 }; 2384 };
2381 2385
2382 VIEW_TEST(BookmarkBarViewTest27, MiddleClickOnFolderOpensAllBookmarks); 2386 VIEW_TEST(BookmarkBarViewTest27, MiddleClickOnFolderOpensAllBookmarks);
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | ui/views/controls/label.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698