OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/layout/LayoutObject.h" |
5 #include "core/layout/LayoutTestHelper.h" | 6 #include "core/layout/LayoutTestHelper.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
7 | 8 |
8 namespace blink { | 9 namespace blink { |
9 | 10 |
10 class TextAutosizerTest : public RenderingTest { | 11 class TextAutosizerTest : public RenderingTest { |
11 private: | 12 private: |
12 void SetUp() override | 13 void SetUp() override |
13 { | 14 { |
14 RenderingTest::SetUp(); | 15 RenderingTest::SetUp(); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 document().settings()->setDeviceScaleAdjustment(2.0f); | 390 document().settings()->setDeviceScaleAdjustment(2.0f); |
390 document().view()->updateAllLifecyclePhases(); | 391 document().view()->updateAllLifecyclePhases(); |
391 | 392 |
392 autosized = document().getElementById("autosized"); | 393 autosized = document().getElementById("autosized"); |
393 EXPECT_FLOAT_EQ(16.f, autosized->layoutObject()->style()->specifiedFontSize(
)); | 394 EXPECT_FLOAT_EQ(16.f, autosized->layoutObject()->style()->specifiedFontSize(
)); |
394 // (device scale adjustment = 2) * (specified font-size = 16px) * (viewport
width = 800px) / (window width = 320px) = 80px. | 395 // (device scale adjustment = 2) * (specified font-size = 16px) * (viewport
width = 800px) / (window width = 320px) = 80px. |
395 EXPECT_FLOAT_EQ(80.f, autosized->layoutObject()->style()->computedFontSize()
); | 396 EXPECT_FLOAT_EQ(80.f, autosized->layoutObject()->style()->computedFontSize()
); |
396 } | 397 } |
397 | 398 |
398 } // namespace blink | 399 } // namespace blink |
OLD | NEW |