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

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

Issue 1347313002: Don't merge adjacent composition markers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unnecessary toElement() call in the unit test 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
« no previous file with comments | « Source/core/editing/markers/DocumentMarkerController.cpp ('k') | no next file » | 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 EXPECT_EQ(1u, renderedRects.size()); 238 EXPECT_EQ(1u, renderedRects.size());
239 EXPECT_NE(invalidRect, renderedRects[0]); 239 EXPECT_NE(invalidRect, renderedRects[0]);
240 240
241 div->setAttribute(HTMLNames::styleAttr, "margin: 200px"); 241 div->setAttribute(HTMLNames::styleAttr, "margin: 200px");
242 document().updateLayout(); 242 document().updateLayout();
243 Vector<IntRect> newRenderedRects = markerController().renderedRectsForMarker s(DocumentMarker::Composition); 243 Vector<IntRect> newRenderedRects = markerController().renderedRectsForMarker s(DocumentMarker::Composition);
244 EXPECT_EQ(1u, newRenderedRects.size()); 244 EXPECT_EQ(1u, newRenderedRects.size());
245 EXPECT_NE(renderedRects[0], newRenderedRects[0]); 245 EXPECT_NE(renderedRects[0], newRenderedRects[0]);
246 } 246 }
247 247
248 TEST_F(DocumentMarkerControllerTest, CompositionMarkersNotMerged)
249 {
250 IntRect invalidRect(RenderedDocumentMarker::create(DocumentMarker(0, 0, fals e))->renderedRect());
251
252 setBodyInnerHTML("<div style='margin: 100px'>foo</div>");
253 RefPtrWillBeRawPtr<Node> text = document().body()->firstChild()->firstChild( );
254 document().updateLayout();
255 markerController().addCompositionMarker(Position(text, 0), Position(text, 1) , Color::black, false, Color::black);
256 markerController().addCompositionMarker(Position(text, 1), Position(text, 3) , Color::black, true, Color::black);
257
258 EXPECT_EQ(2u, markerController().markers().size());
259 }
260
248 } // namespace blink 261 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/markers/DocumentMarkerController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698