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

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

Issue 224113002: Oilpan: move Range object to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use STACK_ALLOCATED() + incorporate ager's overview of macros in this area. Created 6 years, 8 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
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 PassRefPtr<Text> DocumentMarkerControllerTest::createTextNode(const char* textCo ntents) 72 PassRefPtr<Text> DocumentMarkerControllerTest::createTextNode(const char* textCo ntents)
73 { 73 {
74 return document().createTextNode(String::fromUTF8(textContents)); 74 return document().createTextNode(String::fromUTF8(textContents));
75 } 75 }
76 76
77 void DocumentMarkerControllerTest::markNodeContents(PassRefPtr<Node> node) 77 void DocumentMarkerControllerTest::markNodeContents(PassRefPtr<Node> node)
78 { 78 {
79 // Force renderers to be created; TextIterator, which is used in 79 // Force renderers to be created; TextIterator, which is used in
80 // DocumentMarkerControllerTest::addMarker(), needs them. 80 // DocumentMarkerControllerTest::addMarker(), needs them.
81 document().updateLayout(); 81 document().updateLayout();
82 RefPtr<Range> range = rangeOfContents(node.get()); 82 RefPtrWillBeRawPtr<Range> range = rangeOfContents(node.get());
83 markerController().addMarker(range.get(), DocumentMarker::Spelling); 83 markerController().addMarker(range.get(), DocumentMarker::Spelling);
84 } 84 }
85 85
86 void DocumentMarkerControllerTest::setBodyInnerHTML(const char* bodyContent) 86 void DocumentMarkerControllerTest::setBodyInnerHTML(const char* bodyContent)
87 { 87 {
88 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION); 88 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION);
89 } 89 }
90 90
91 TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByNormalize) 91 TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByNormalize)
92 { 92 {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 setBodyInnerHTML(""); 193 setBodyInnerHTML("");
194 } 194 }
195 // No more reference to marked node. 195 // No more reference to marked node.
196 #if ENABLE(OILPAN) 196 #if ENABLE(OILPAN)
197 Heap::collectAllGarbage(WebCore::ThreadState::NoHeapPointersOnStack); 197 Heap::collectAllGarbage(WebCore::ThreadState::NoHeapPointersOnStack);
198 #endif 198 #endif
199 EXPECT_EQ(0u, markerController().markers().size()); 199 EXPECT_EQ(0u, markerController().markers().size());
200 } 200 }
201 201
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698