OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 using namespace WebCore; | 45 using namespace WebCore; |
46 | 46 |
47 namespace { | 47 namespace { |
48 | 48 |
49 class DocumentMarkerControllerTest : public ::testing::Test { | 49 class DocumentMarkerControllerTest : public ::testing::Test { |
50 protected: | 50 protected: |
51 virtual void SetUp() OVERRIDE; | 51 virtual void SetUp() OVERRIDE; |
52 | 52 |
53 Document& document() const { return *m_document; } | 53 Document& document() const { return *m_document; } |
54 DocumentMarkerController& markerController() const { return *m_document->mar
kers(); } | 54 DocumentMarkerController& markerController() const { return m_document->mark
ers(); } |
55 | 55 |
56 PassRefPtr<Text> createTextNode(const char*); | 56 PassRefPtr<Text> createTextNode(const char*); |
57 void markNodeContents(PassRefPtr<Node>); | 57 void markNodeContents(PassRefPtr<Node>); |
58 void setBodyInnerHTML(const char*); | 58 void setBodyInnerHTML(const char*); |
59 | 59 |
60 private: | 60 private: |
61 OwnPtr<DummyPageHolder> m_dummyPageHolder; | 61 OwnPtr<DummyPageHolder> m_dummyPageHolder; |
62 Document* m_document; | 62 Document* m_document; |
63 }; | 63 }; |
64 | 64 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 RefPtr<Element> parent = toElement(document().body()->firstChild()->firs
tChild()); | 172 RefPtr<Element> parent = toElement(document().body()->firstChild()->firs
tChild()); |
173 markNodeContents(parent); | 173 markNodeContents(parent); |
174 EXPECT_EQ(1u, markerController().markers().size()); | 174 EXPECT_EQ(1u, markerController().markers().size()); |
175 setBodyInnerHTML(""); | 175 setBodyInnerHTML(""); |
176 } | 176 } |
177 // No more reference to marked node. | 177 // No more reference to marked node. |
178 EXPECT_EQ(0u, markerController().markers().size()); | 178 EXPECT_EQ(0u, markerController().markers().size()); |
179 } | 179 } |
180 | 180 |
181 } | 181 } |
OLD | NEW |