Chromium Code Reviews| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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()); |
|
eae
2015/08/25 17:47:16
renderRect() returns a LayoutRect, this implicitly
chrishtr
2015/08/25 18:30:43
It's implicit in the same way that renderedRectsFo
| |
| 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 |
| OLD | NEW |