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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 | 245 |
246 setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); | 246 setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); |
247 RefPtrWillBeRawPtr<Node> text = document().body()->firstChild()->firstChild( ); | 247 RefPtrWillBeRawPtr<Node> text = document().body()->firstChild()->firstChild( ); |
248 document().updateLayout(); | 248 document().updateLayout(); |
249 markerController().addCompositionMarker(Position(text, 0), Position(text, 1) , Color::black, false, Color::black); | 249 markerController().addCompositionMarker(Position(text, 0), Position(text, 1) , Color::black, false, Color::black); |
250 markerController().addCompositionMarker(Position(text, 1), Position(text, 3) , Color::black, true, Color::black); | 250 markerController().addCompositionMarker(Position(text, 1), Position(text, 3) , Color::black, true, Color::black); |
251 | 251 |
252 EXPECT_EQ(2u, markerController().markers().size()); | 252 EXPECT_EQ(2u, markerController().markers().size()); |
253 } | 253 } |
254 | 254 |
255 TEST_F(DocumentMarkerControllerTest, SetMarkerActiveTest) | |
256 { | |
257 setBodyInnerHTML("<b>foo</b>"); | |
258 RefPtrWillBeRawPtr<Element> bElement = toElement(document().body()->firstChi ld()); | |
259 EphemeralRange ephemeralRange = EphemeralRange::rangeOfContents(*bElement); | |
260 RefPtrWillBeRawPtr<Range> range = Range::create(document(), toPositionInDOMT ree(ephemeralRange.startPosition()), toPositionInDOMTree(ephemeralRange.endPosit ion())); | |
Finnur
2016/01/29 17:47:49
nit: Break up into two lines for readability?
dvadym
2016/02/01 12:41:10
Done.
| |
261 | |
262 // Try to make active a marker that doesn't exist. | |
263 EXPECT_FALSE(markerController().setMarkersActive(range, true)); | |
264 | |
265 // Add a marker and try it once more. | |
266 markerController().addTextMatchMarker(range, false); | |
267 EXPECT_EQ(1u, markerController().markers().size()); | |
268 EXPECT_TRUE(markerController().setMarkersActive(range, true)); | |
269 } | |
270 | |
255 } // namespace blink | 271 } // namespace blink |
OLD | NEW |