| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 ASSERT_EQ(5, styled()->child_count()); | 345 ASSERT_EQ(5, styled()->child_count()); |
| 346 EXPECT_EQ(0, styled()->child_at(0)->bounds().x()); | 346 EXPECT_EQ(0, styled()->child_at(0)->bounds().x()); |
| 347 EXPECT_EQ(styled()->child_at(0)->bounds().right() - 2, | 347 EXPECT_EQ(styled()->child_at(0)->bounds().right() - 2, |
| 348 styled()->child_at(1)->bounds().x()); | 348 styled()->child_at(1)->bounds().x()); |
| 349 EXPECT_EQ(0, styled()->child_at(2)->bounds().x()); | 349 EXPECT_EQ(0, styled()->child_at(2)->bounds().x()); |
| 350 EXPECT_EQ(styled()->child_at(2)->bounds().right() - 2, | 350 EXPECT_EQ(styled()->child_at(2)->bounds().right() - 2, |
| 351 styled()->child_at(3)->bounds().x()); | 351 styled()->child_at(3)->bounds().x()); |
| 352 EXPECT_EQ(0, styled()->child_at(4)->bounds().x()); | 352 EXPECT_EQ(0, styled()->child_at(4)->bounds().x()); |
| 353 | 353 |
| 354 string16 tooltip; | 354 base::string16 tooltip; |
| 355 EXPECT_TRUE( | 355 EXPECT_TRUE( |
| 356 styled()->child_at(1)->GetTooltipText(gfx::Point(1, 1), &tooltip)); | 356 styled()->child_at(1)->GetTooltipText(gfx::Point(1, 1), &tooltip)); |
| 357 EXPECT_EQ(ASCIIToUTF16("tooltip"), tooltip); | 357 EXPECT_EQ(ASCIIToUTF16("tooltip"), tooltip); |
| 358 EXPECT_TRUE( | 358 EXPECT_TRUE( |
| 359 styled()->child_at(2)->GetTooltipText(gfx::Point(1, 1), &tooltip)); | 359 styled()->child_at(2)->GetTooltipText(gfx::Point(1, 1), &tooltip)); |
| 360 EXPECT_EQ(ASCIIToUTF16("tooltip"), tooltip); | 360 EXPECT_EQ(ASCIIToUTF16("tooltip"), tooltip); |
| 361 } | 361 } |
| 362 | 362 |
| 363 TEST_F(StyledLabelTest, HandleEmptyLayout) { | 363 TEST_F(StyledLabelTest, HandleEmptyLayout) { |
| 364 const std::string text("This is a test block of text, "); | 364 const std::string text("This is a test block of text, "); |
| 365 InitStyledLabel(text); | 365 InitStyledLabel(text); |
| 366 styled()->Layout(); | 366 styled()->Layout(); |
| 367 ASSERT_EQ(0, styled()->child_count()); | 367 ASSERT_EQ(0, styled()->child_count()); |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace | 370 } // namespace |
| OLD | NEW |