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

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

Issue 301233010: Oilpan: use transition types for remaining RefPtr<Document>s in dom/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, DidMoveToNewDocument) 91 TEST_F(DocumentMarkerControllerTest, DidMoveToNewDocument)
92 { 92 {
93 setBodyInnerHTML("<b><i>foo</i></b>"); 93 setBodyInnerHTML("<b><i>foo</i></b>");
94 RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild ()->firstChild()); 94 RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild ()->firstChild());
95 markNodeContents(parent.get()); 95 markNodeContents(parent.get());
96 EXPECT_EQ(1u, markerController().markers().size()); 96 EXPECT_EQ(1u, markerController().markers().size());
97 RefPtr<Document> anotherDocument = Document::create(); 97 RefPtrWillBePersistent<Document> anotherDocument = Document::create();
98 anotherDocument->adoptNode(parent.get(), ASSERT_NO_EXCEPTION); 98 anotherDocument->adoptNode(parent.get(), ASSERT_NO_EXCEPTION);
99 99
100 // No more reference to marked node. 100 // No more reference to marked node.
101 Heap::collectAllGarbage(); 101 Heap::collectAllGarbage();
102 EXPECT_EQ(0u, markerController().markers().size()); 102 EXPECT_EQ(0u, markerController().markers().size());
103 EXPECT_EQ(0u, anotherDocument->markers().markers().size()); 103 EXPECT_EQ(0u, anotherDocument->markers().markers().size());
104 } 104 }
105 105
106 TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByNormalize) 106 TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByNormalize)
107 { 107 {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 markNodeContents(parent); 194 markNodeContents(parent);
195 EXPECT_EQ(1u, markerController().markers().size()); 195 EXPECT_EQ(1u, markerController().markers().size());
196 setBodyInnerHTML(""); 196 setBodyInnerHTML("");
197 } 197 }
198 // No more reference to marked node. 198 // No more reference to marked node.
199 Heap::collectAllGarbage(); 199 Heap::collectAllGarbage();
200 EXPECT_EQ(0u, markerController().markers().size()); 200 EXPECT_EQ(0u, markerController().markers().size());
201 } 201 }
202 202
203 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698