| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 EXPECT_EQ("251x61", layout_manager_->GetMinimumSize(kWidth).ToString()); | 507 EXPECT_EQ("251x61", layout_manager_->GetMinimumSize(kWidth).ToString()); |
| 508 | 508 |
| 509 // A normal window with no window icon still produces icon bounds for | 509 // A normal window with no window icon still produces icon bounds for |
| 510 // Windows, which has a hidden icon that a user can double click on to close | 510 // Windows, which has a hidden icon that a user can double click on to close |
| 511 // the window. | 511 // the window. |
| 512 EXPECT_EQ("2,0 17x17", layout_manager_->IconBounds().ToString()); | 512 EXPECT_EQ("2,0 17x17", layout_manager_->IconBounds().ToString()); |
| 513 } | 513 } |
| 514 | 514 |
| 515 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithNewAvatar) { | 515 TEST_F(OpaqueBrowserFrameViewLayoutTest, WindowWithNewAvatar) { |
| 516 CommandLine::ForCurrentProcess()->AppendSwitch( | 516 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 517 switches::kNewProfileManagement); | 517 switches::kEnableNewProfileManagement); |
| 518 | 518 |
| 519 // Tests a normal tabstrip window with the new style avatar icon. | 519 // Tests a normal tabstrip window with the new style avatar icon. |
| 520 AddNewAvatarButton(); | 520 AddNewAvatarButton(); |
| 521 root_view_->Layout(); | 521 root_view_->Layout(); |
| 522 | 522 |
| 523 ExpectBasicWindowBounds(); | 523 ExpectBasicWindowBounds(); |
| 524 | 524 |
| 525 // Check the location of the caption button | 525 // Check the location of the caption button |
| 526 EXPECT_EQ("385,1 12x20", new_avatar_button_->bounds().ToString()); | 526 EXPECT_EQ("385,1 12x20", new_avatar_button_->bounds().ToString()); |
| 527 // The basic window bounds are (-1, 13 398x29). There should not be an icon | 527 // The basic window bounds are (-1, 13 398x29). There should not be an icon |
| (...skipping 13 matching lines...) Expand all Loading... |
| 541 | 541 |
| 542 // Check the location of the avatar label relative to the avatar button if | 542 // Check the location of the avatar label relative to the avatar button if |
| 543 // both are displayed on the left side. | 543 // both are displayed on the left side. |
| 544 // The label height and width depends on the font size and the text displayed. | 544 // The label height and width depends on the font size and the text displayed. |
| 545 // This may possibly change, so we don't test it here. | 545 // This may possibly change, so we don't test it here. |
| 546 EXPECT_EQ(menu_button_->bounds().x() - 2, avatar_label_->bounds().x()); | 546 EXPECT_EQ(menu_button_->bounds().x() - 2, avatar_label_->bounds().x()); |
| 547 EXPECT_EQ( | 547 EXPECT_EQ( |
| 548 menu_button_->bounds().bottom() - 3 - avatar_label_->bounds().height(), | 548 menu_button_->bounds().bottom() - 3 - avatar_label_->bounds().height(), |
| 549 avatar_label_->bounds().y()); | 549 avatar_label_->bounds().y()); |
| 550 } | 550 } |
| OLD | NEW |