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

Side by Side Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc

Issue 598163002: [Win] Redesign the new avatar button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move static var declaration Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/ui/views/profiles/avatar_label.h" 10 #include "chrome/browser/ui/views/profiles/avatar_label.h"
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 521
522 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithNewAvatar) { 522 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithNewAvatar) {
523 // Tests a normal tabstrip window with the new style avatar icon. 523 // Tests a normal tabstrip window with the new style avatar icon.
524 AddNewAvatarButton(); 524 AddNewAvatarButton();
525 root_view_->Layout(); 525 root_view_->Layout();
526 526
527 ExpectBasicWindowBounds(); 527 ExpectBasicWindowBounds();
528 528
529 // Check the location of the avatar button. 529 // Check the location of the avatar button.
530 EXPECT_EQ("385,1 12x18", new_avatar_button_->bounds().ToString()); 530 EXPECT_EQ("385,1 12x18", new_avatar_button_->bounds().ToString());
531 // The basic window bounds are (-1, 13 398x29). There should not be an icon 531 // The new tab button is 39px wide and slides completely under the new
532 // avatar in the left, and the new avatar button has an offset of 5 to its 532 // avatar button, thus increasing the tabstrip by that amount.
533 // next control. 533 EXPECT_EQ("-1,13 420x29",
534 EXPECT_EQ("-1,13 381x29",
535 layout_manager_->GetBoundsForTabStrip( 534 layout_manager_->GetBoundsForTabStrip(
536 delegate_->GetTabstripPreferredSize(), kWidth).ToString()); 535 delegate_->GetTabstripPreferredSize(), kWidth).ToString());
537 EXPECT_EQ("261x73", layout_manager_->GetMinimumSize(kWidth).ToString()); 536 EXPECT_EQ("261x73", layout_manager_->GetMinimumSize(kWidth).ToString());
538 } 537 }
539 538
540 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithAvatarLabelAndButtonOnLeft) { 539 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithAvatarLabelAndButtonOnLeft) {
541 AddAvatarLabel(); 540 AddAvatarLabel();
542 root_view_->Layout(); 541 root_view_->Layout();
543 542
544 ExpectBasicWindowBounds(); 543 ExpectBasicWindowBounds();
545 544
546 // Check the location of the avatar label relative to the avatar button if 545 // Check the location of the avatar label relative to the avatar button if
547 // both are displayed on the left side. 546 // both are displayed on the left side.
548 // The label height and width depends on the font size and the text displayed. 547 // The label height and width depends on the font size and the text displayed.
549 // This may possibly change, so we don't test it here. 548 // This may possibly change, so we don't test it here.
550 EXPECT_EQ(menu_button_->bounds().x() - 2, avatar_label_->bounds().x()); 549 EXPECT_EQ(menu_button_->bounds().x() - 2, avatar_label_->bounds().x());
551 EXPECT_EQ( 550 EXPECT_EQ(
552 menu_button_->bounds().bottom() - 3 - avatar_label_->bounds().height(), 551 menu_button_->bounds().bottom() - 3 - avatar_label_->bounds().height(),
553 avatar_label_->bounds().y()); 552 avatar_label_->bounds().y());
554 } 553 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698