| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return rect; | 119 return rect; |
| 120 } | 120 } |
| 121 | 121 |
| 122 void registerMockedHttpURLLoad(const std::string& fileName) | 122 void registerMockedHttpURLLoad(const std::string& fileName) |
| 123 { | 123 { |
| 124 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU
RL.c_str()), WebString::fromUTF8(fileName.c_str())); | 124 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU
RL.c_str()), WebString::fromUTF8(fileName.c_str())); |
| 125 } | 125 } |
| 126 | 126 |
| 127 const std::string m_baseURL; | 127 const std::string m_baseURL; |
| 128 MockWebFrameClient m_mockWebViewClient; | 128 MockWebFrameClient m_mockWebViewClient; |
| 129 FrameTestHelpers::UseMockScrollbarSettings m_mockScrollbarSettings; |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 TEST_F(LayoutGeometryMapTest, SimpleGeometryMapTest) | 132 TEST_F(LayoutGeometryMapTest, SimpleGeometryMapTest) |
| 132 { | 133 { |
| 133 registerMockedHttpURLLoad("rgm_test.html"); | 134 registerMockedHttpURLLoad("rgm_test.html"); |
| 134 FrameTestHelpers::WebViewHelper webViewHelper; | 135 FrameTestHelpers::WebViewHelper webViewHelper; |
| 135 WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "rgm_test.htm
l", true, 0, 0); | 136 WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "rgm_test.htm
l", true, 0, 0); |
| 136 webView->resize(WebSize(1000, 1000)); | 137 webView->resize(WebSize(1000, 1000)); |
| 137 webView->layout(); | 138 webView->layout(); |
| 138 | 139 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 EXPECT_NEAR(8.0f + offset * 2.0f, rgm.mapToContainer(point, nullptr).x(), 0.
1f); | 386 EXPECT_NEAR(8.0f + offset * 2.0f, rgm.mapToContainer(point, nullptr).x(), 0.
1f); |
| 386 EXPECT_NEAR(8.0f, rgm.mapToContainer(point, nullptr).y(), 0.1f); | 387 EXPECT_NEAR(8.0f, rgm.mapToContainer(point, nullptr).y(), 0.1f); |
| 387 EXPECT_NEAR(8.0f + offset * 2.0f, rectFromQuad(rgm.mapToContainer(rect, null
ptr)).x(), 0.1f); | 388 EXPECT_NEAR(8.0f + offset * 2.0f, rectFromQuad(rgm.mapToContainer(rect, null
ptr)).x(), 0.1f); |
| 388 EXPECT_NEAR(8.0f, rectFromQuad(rgm.mapToContainer(rect, nullptr)).y(), 0.1f)
; | 389 EXPECT_NEAR(8.0f, rectFromQuad(rgm.mapToContainer(rect, nullptr)).y(), 0.1f)
; |
| 389 EXPECT_EQ(5.0f, rectFromQuad(rgm.mapToContainer(rect, nullptr)).width()); | 390 EXPECT_EQ(5.0f, rectFromQuad(rgm.mapToContainer(rect, nullptr)).width()); |
| 390 EXPECT_EQ(3.0f, rectFromQuad(rgm.mapToContainer(rect, nullptr)).height()); | 391 EXPECT_EQ(3.0f, rectFromQuad(rgm.mapToContainer(rect, nullptr)).height()); |
| 391 | 392 |
| 392 } | 393 } |
| 393 | 394 |
| 394 } // namespace blink | 395 } // namespace blink |
| OLD | NEW |