Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: Source/core/dom/DocumentMarkerControllerTest.cpp

Issue 181693003: Have Document::markers() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698