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

Side by Side Diff: Source/core/editing/markers/DocumentMarkerControllerTest.cpp

Issue 1303413004: Convert some call sites to use explicit LayoutRect->FloatRect conversion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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/editing/Editor.cpp ('k') | Source/core/frame/RootFrameViewport.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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 EXPECT_EQ(1u, markerController().markers().size()); 194 EXPECT_EQ(1u, markerController().markers().size());
195 setBodyInnerHTML(""); 195 setBodyInnerHTML("");
196 } 196 }
197 // No more reference to marked node. 197 // No more reference to marked node.
198 Heap::collectAllGarbage(); 198 Heap::collectAllGarbage();
199 EXPECT_EQ(0u, markerController().markers().size()); 199 EXPECT_EQ(0u, markerController().markers().size());
200 } 200 }
201 201
202 TEST_F(DocumentMarkerControllerTest, UpdateRenderedRects) 202 TEST_F(DocumentMarkerControllerTest, UpdateRenderedRects)
203 { 203 {
204 LayoutRect invalidRect = RenderedDocumentMarker::create(DocumentMarker(0, 0, false))->renderedRect(); 204 IntRect invalidRect(RenderedDocumentMarker::create(DocumentMarker(0, 0, fals e))->renderedRect());
205 205
206 setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); 206 setBodyInnerHTML("<div style='margin: 100px'>foo</div>");
207 RefPtrWillBeRawPtr<Element> div = toElement(document().body()->firstChild()) ; 207 RefPtrWillBeRawPtr<Element> div = toElement(document().body()->firstChild()) ;
208 markNodeContents(div); 208 markNodeContents(div);
209 Vector<IntRect> renderedRects = markerController().renderedRectsForMarkers(D ocumentMarker::Spelling); 209 Vector<IntRect> renderedRects = markerController().renderedRectsForMarkers(D ocumentMarker::Spelling);
210 EXPECT_EQ(1u, renderedRects.size()); 210 EXPECT_EQ(1u, renderedRects.size());
211 EXPECT_NE(invalidRect, renderedRects[0]); 211 EXPECT_NE(invalidRect, renderedRects[0]);
212 212
213 div->setAttribute(HTMLNames::styleAttr, "margin: 200px"); 213 div->setAttribute(HTMLNames::styleAttr, "margin: 200px");
214 document().updateLayout(); 214 document().updateLayout();
215 Vector<IntRect> newRenderedRects = markerController().renderedRectsForMarker s(DocumentMarker::Spelling); 215 Vector<IntRect> newRenderedRects = markerController().renderedRectsForMarker s(DocumentMarker::Spelling);
216 EXPECT_EQ(1u, newRenderedRects.size()); 216 EXPECT_EQ(1u, newRenderedRects.size());
217 EXPECT_NE(renderedRects[0], newRenderedRects[0]); 217 EXPECT_NE(renderedRects[0], newRenderedRects[0]);
218 } 218 }
219 219
220 } // namespace blink 220 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/frame/RootFrameViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698