| OLD | NEW |
| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 EXPECT_EQ("2,0 17x17", layout_manager_->IconBounds().ToString()); | 519 EXPECT_EQ("2,0 17x17", layout_manager_->IconBounds().ToString()); |
| 520 } | 520 } |
| 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 caption button | 529 // Check the location of the avatar button. |
| 530 EXPECT_EQ("385,1 12x20", 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 basic window bounds are (-1, 13 398x29). There should not be an icon |
| 532 // avatar in the left, and the new avatar button has an offset of 5 to its | 532 // avatar in the left, and the new avatar button has an offset of 5 to its |
| 533 // next control. | 533 // next control. |
| 534 EXPECT_EQ("-1,13 381x29", | 534 EXPECT_EQ("-1,13 381x29", |
| 535 layout_manager_->GetBoundsForTabStrip( | 535 layout_manager_->GetBoundsForTabStrip( |
| 536 delegate_->GetTabstripPreferredSize(), kWidth).ToString()); | 536 delegate_->GetTabstripPreferredSize(), kWidth).ToString()); |
| 537 EXPECT_EQ("261x73", layout_manager_->GetMinimumSize(kWidth).ToString()); | 537 EXPECT_EQ("261x73", layout_manager_->GetMinimumSize(kWidth).ToString()); |
| 538 } | 538 } |
| 539 | 539 |
| 540 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithAvatarLabelAndButtonOnLeft) { | 540 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithAvatarLabelAndButtonOnLeft) { |
| 541 AddAvatarLabel(); | 541 AddAvatarLabel(); |
| 542 root_view_->Layout(); | 542 root_view_->Layout(); |
| 543 | 543 |
| 544 ExpectBasicWindowBounds(); | 544 ExpectBasicWindowBounds(); |
| 545 | 545 |
| 546 // Check the location of the avatar label relative to the avatar button if | 546 // Check the location of the avatar label relative to the avatar button if |
| 547 // both are displayed on the left side. | 547 // both are displayed on the left side. |
| 548 // The label height and width depends on the font size and the text displayed. | 548 // 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. | 549 // This may possibly change, so we don't test it here. |
| 550 EXPECT_EQ(menu_button_->bounds().x() - 2, avatar_label_->bounds().x()); | 550 EXPECT_EQ(menu_button_->bounds().x() - 2, avatar_label_->bounds().x()); |
| 551 EXPECT_EQ( | 551 EXPECT_EQ( |
| 552 menu_button_->bounds().bottom() - 3 - avatar_label_->bounds().height(), | 552 menu_button_->bounds().bottom() - 3 - avatar_label_->bounds().height(), |
| 553 avatar_label_->bounds().y()); | 553 avatar_label_->bounds().y()); |
| 554 } | 554 } |
| OLD | NEW |