| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef EditingTestBase_h | 5 #ifndef EditingTestBase_h |
| 6 #define EditingTestBase_h | 6 #define EditingTestBase_h |
| 7 | 7 |
| 8 #include "core/editing/Position.h" | 8 #include "core/editing/Position.h" |
| 9 #include "wtf/Forward.h" | 9 #include "wtf/Forward.h" |
| 10 #include <gtest/gtest.h> | 10 #include <gtest/gtest.h> |
| 11 #include <memory> | |
| 12 #include <string> | 11 #include <string> |
| 13 | 12 |
| 14 namespace blink { | 13 namespace blink { |
| 15 | 14 |
| 16 class DummyPageHolder; | 15 class DummyPageHolder; |
| 17 | 16 |
| 18 class EditingTestBase : public ::testing::Test { | 17 class EditingTestBase : public ::testing::Test { |
| 19 USING_FAST_MALLOC(EditingTestBase); | 18 USING_FAST_MALLOC(EditingTestBase); |
| 20 protected: | 19 protected: |
| 21 EditingTestBase(); | 20 EditingTestBase(); |
| 22 ~EditingTestBase() override; | 21 ~EditingTestBase() override; |
| 23 | 22 |
| 24 void SetUp() override; | 23 void SetUp() override; |
| 25 | 24 |
| 26 Document& document() const; | 25 Document& document() const; |
| 27 DummyPageHolder& dummyPageHolder() const { return *m_dummyPageHolder; } | 26 DummyPageHolder& dummyPageHolder() const { return *m_dummyPageHolder; } |
| 28 | 27 |
| 29 static ShadowRoot* createShadowRootForElementWithIDAndSetInnerHTML(TreeScope
&, const char* hostElementID, const char* shadowRootContent); | 28 static ShadowRoot* createShadowRootForElementWithIDAndSetInnerHTML(TreeScope
&, const char* hostElementID, const char* shadowRootContent); |
| 30 | 29 |
| 31 void setBodyContent(const std::string&); | 30 void setBodyContent(const std::string&); |
| 32 ShadowRoot* setShadowContent(const char* shadowContent, const char* shadowHo
stId); | 31 ShadowRoot* setShadowContent(const char* shadowContent, const char* shadowHo
stId); |
| 33 void updateAllLifecyclePhases(); | 32 void updateAllLifecyclePhases(); |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; | 35 OwnPtr<DummyPageHolder> m_dummyPageHolder; |
| 37 }; | 36 }; |
| 38 | 37 |
| 39 } // namespace blink | 38 } // namespace blink |
| 40 | 39 |
| 41 #endif // EditingTestBase_h | 40 #endif // EditingTestBase_h |
| OLD | NEW |