| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/layout/LayoutGeometryMap.h" | 31 #include "core/layout/LayoutGeometryMap.h" |
| 32 | 32 |
| 33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 34 #include "core/layout/LayoutBox.h" | 34 #include "core/layout/LayoutBox.h" |
| 35 #include "core/layout/LayoutView.h" | 35 #include "core/layout/LayoutView.h" |
| 36 #include "core/paint/PaintLayer.h" | 36 #include "core/paint/PaintLayer.h" |
| 37 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" | 37 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" |
| 38 #include "platform/testing/URLTestHelpers.h" | 38 #include "platform/testing/URLTestHelpers.h" |
| 39 #include "platform/testing/UnitTestHelpers.h" | 39 #include "platform/testing/UnitTestHelpers.h" |
| 40 #include "public/platform/Platform.h" | 40 #include "public/platform/Platform.h" |
| 41 #include "public/platform/WebCache.h" | |
| 42 #include "public/platform/WebURLLoaderMockFactory.h" | 41 #include "public/platform/WebURLLoaderMockFactory.h" |
| 43 #include "public/web/WebFrameClient.h" | 42 #include "public/web/WebFrameClient.h" |
| 44 #include "testing/gtest/include/gtest/gtest.h" | 43 #include "testing/gtest/include/gtest/gtest.h" |
| 45 #include "web/WebLocalFrameImpl.h" | 44 #include "web/WebLocalFrameImpl.h" |
| 46 #include "web/tests/FrameTestHelpers.h" | 45 #include "web/tests/FrameTestHelpers.h" |
| 47 | 46 |
| 48 namespace blink { | 47 namespace blink { |
| 49 | 48 |
| 50 typedef bool TestParamRootLayerScrolling; | 49 typedef bool TestParamRootLayerScrolling; |
| 51 class LayoutGeometryMapTest | 50 class LayoutGeometryMapTest |
| 52 : public ::testing::Test, | 51 : public ::testing::Test, |
| 53 public ::testing::WithParamInterface<TestParamRootLayerScrolling>, | 52 public ::testing::WithParamInterface<TestParamRootLayerScrolling>, |
| 54 private ScopedRootLayerScrollingForTest { | 53 private ScopedRootLayerScrollingForTest { |
| 55 public: | 54 public: |
| 56 LayoutGeometryMapTest() | 55 LayoutGeometryMapTest() |
| 57 : ScopedRootLayerScrollingForTest(GetParam()), | 56 : ScopedRootLayerScrollingForTest(GetParam()), |
| 58 m_baseURL("http://www.test.com/") {} | 57 m_baseURL("http://www.test.com/") {} |
| 59 | 58 |
| 60 void TearDown() override { | 59 void TearDown() override { |
| 61 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 60 Platform::current() |
| 62 WebCache::clear(); | 61 ->getURLLoaderMockFactory() |
| 62 ->unregisterAllURLsAndClearMemoryCache(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 static LayoutBox* getFrameElement(const char* iframeName, | 66 static LayoutBox* getFrameElement(const char* iframeName, |
| 67 WebView* webView, | 67 WebView* webView, |
| 68 const WTF::AtomicString& elementId) { | 68 const WTF::AtomicString& elementId) { |
| 69 WebLocalFrameImpl* iframe = toWebLocalFrameImpl( | 69 WebLocalFrameImpl* iframe = toWebLocalFrameImpl( |
| 70 webView->findFrameByName(WebString::fromUTF8(iframeName))); | 70 webView->findFrameByName(WebString::fromUTF8(iframeName))); |
| 71 if (!iframe) | 71 if (!iframe) |
| 72 return nullptr; | 72 return nullptr; |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f), | 528 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f), |
| 529 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); | 529 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); |
| 530 | 530 |
| 531 rgm.pushMappingsToAncestor(floating, span); | 531 rgm.pushMappingsToAncestor(floating, span); |
| 532 EXPECT_EQ(rect, rectFromQuad(rgm.mapToAncestor(rect, container))); | 532 EXPECT_EQ(rect, rectFromQuad(rgm.mapToAncestor(rect, container))); |
| 533 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f), | 533 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f), |
| 534 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); | 534 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); |
| 535 } | 535 } |
| 536 | 536 |
| 537 } // namespace blink | 537 } // namespace blink |
| OLD | NEW |