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

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

Issue 2801483002: Add DocumentMarker::MatchStatus enum for text match markers (Closed)
Patch Set: Add k prefix Created 3 years, 8 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 document().updateStyleAndLayout(); 244 document().updateStyleAndLayout();
245 Element* bElement = toElement(document().body()->firstChild()); 245 Element* bElement = toElement(document().body()->firstChild());
246 EphemeralRange ephemeralRange = EphemeralRange::rangeOfContents(*bElement); 246 EphemeralRange ephemeralRange = EphemeralRange::rangeOfContents(*bElement);
247 Position startBElement = toPositionInDOMTree(ephemeralRange.startPosition()); 247 Position startBElement = toPositionInDOMTree(ephemeralRange.startPosition());
248 Position endBElement = toPositionInDOMTree(ephemeralRange.endPosition()); 248 Position endBElement = toPositionInDOMTree(ephemeralRange.endPosition());
249 const EphemeralRange range(startBElement, endBElement); 249 const EphemeralRange range(startBElement, endBElement);
250 // Try to make active a marker that doesn't exist. 250 // Try to make active a marker that doesn't exist.
251 EXPECT_FALSE(markerController().setMarkersActive(range, true)); 251 EXPECT_FALSE(markerController().setMarkersActive(range, true));
252 252
253 // Add a marker and try it once more. 253 // Add a marker and try it once more.
254 markerController().addTextMatchMarker(range, false); 254 markerController().addTextMatchMarker(range,
255 DocumentMarker::MatchStatus::kInactive);
255 EXPECT_EQ(1u, markerController().markers().size()); 256 EXPECT_EQ(1u, markerController().markers().size());
256 EXPECT_TRUE(markerController().setMarkersActive(range, true)); 257 EXPECT_TRUE(markerController().setMarkersActive(range, true));
257 } 258 }
258 259
259 } // namespace blink 260 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698