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> |
11 #include <string> | 12 #include <string> |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 class DummyPageHolder; | 16 class DummyPageHolder; |
16 | 17 |
17 class EditingTestBase : public ::testing::Test { | 18 class EditingTestBase : public ::testing::Test { |
18 USING_FAST_MALLOC(EditingTestBase); | 19 USING_FAST_MALLOC(EditingTestBase); |
19 protected: | 20 protected: |
20 EditingTestBase(); | 21 EditingTestBase(); |
21 ~EditingTestBase() override; | 22 ~EditingTestBase() override; |
22 | 23 |
23 void SetUp() override; | 24 void SetUp() override; |
24 | 25 |
25 Document& document() const; | 26 Document& document() const; |
26 DummyPageHolder& dummyPageHolder() const { return *m_dummyPageHolder; } | 27 DummyPageHolder& dummyPageHolder() const { return *m_dummyPageHolder; } |
27 | 28 |
28 static ShadowRoot* createShadowRootForElementWithIDAndSetInnerHTML(TreeScope
&, const char* hostElementID, const char* shadowRootContent); | 29 static ShadowRoot* createShadowRootForElementWithIDAndSetInnerHTML(TreeScope
&, const char* hostElementID, const char* shadowRootContent); |
29 | 30 |
30 void setBodyContent(const std::string&); | 31 void setBodyContent(const std::string&); |
31 ShadowRoot* setShadowContent(const char* shadowContent, const char* shadowHo
stId); | 32 ShadowRoot* setShadowContent(const char* shadowContent, const char* shadowHo
stId); |
32 void updateAllLifecyclePhases(); | 33 void updateAllLifecyclePhases(); |
33 | 34 |
34 private: | 35 private: |
35 OwnPtr<DummyPageHolder> m_dummyPageHolder; | 36 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; |
36 }; | 37 }; |
37 | 38 |
38 } // namespace blink | 39 } // namespace blink |
39 | 40 |
40 #endif // EditingTestBase_h | 41 #endif // EditingTestBase_h |
OLD | NEW |