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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2911723002: [DMC #24] Add SpellingMarker and GrammarMarker (subclasses of DocumentMarker) (Closed)
Patch Set: Add IsSpellCheckMarker() tests Created 3 years, 6 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #include "core/dom/shadow/ElementShadowV0.h" 58 #include "core/dom/shadow/ElementShadowV0.h"
59 #include "core/dom/shadow/FlatTreeTraversal.h" 59 #include "core/dom/shadow/FlatTreeTraversal.h"
60 #include "core/dom/shadow/SelectRuleFeatureSet.h" 60 #include "core/dom/shadow/SelectRuleFeatureSet.h"
61 #include "core/dom/shadow/ShadowRoot.h" 61 #include "core/dom/shadow/ShadowRoot.h"
62 #include "core/editing/Editor.h" 62 #include "core/editing/Editor.h"
63 #include "core/editing/PlainTextRange.h" 63 #include "core/editing/PlainTextRange.h"
64 #include "core/editing/SurroundingText.h" 64 #include "core/editing/SurroundingText.h"
65 #include "core/editing/iterators/TextIterator.h" 65 #include "core/editing/iterators/TextIterator.h"
66 #include "core/editing/markers/DocumentMarker.h" 66 #include "core/editing/markers/DocumentMarker.h"
67 #include "core/editing/markers/DocumentMarkerController.h" 67 #include "core/editing/markers/DocumentMarkerController.h"
68 #include "core/editing/markers/SpellCheckMarker.h"
68 #include "core/editing/markers/TextMatchMarker.h" 69 #include "core/editing/markers/TextMatchMarker.h"
69 #include "core/editing/serializers/Serialization.h" 70 #include "core/editing/serializers/Serialization.h"
70 #include "core/editing/spellcheck/IdleSpellCheckCallback.h" 71 #include "core/editing/spellcheck/IdleSpellCheckCallback.h"
71 #include "core/editing/spellcheck/SpellCheckRequester.h" 72 #include "core/editing/spellcheck/SpellCheckRequester.h"
72 #include "core/editing/spellcheck/SpellChecker.h" 73 #include "core/editing/spellcheck/SpellChecker.h"
73 #include "core/frame/EventHandlerRegistry.h" 74 #include "core/frame/EventHandlerRegistry.h"
74 #include "core/frame/FrameConsole.h" 75 #include "core/frame/FrameConsole.h"
75 #include "core/frame/LocalDOMWindow.h" 76 #include "core/frame/LocalDOMWindow.h"
76 #include "core/frame/LocalFrame.h" 77 #include "core/frame/LocalFrame.h"
77 #include "core/frame/LocalFrameView.h" 78 #include "core/frame/LocalFrameView.h"
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 return nullptr; 1004 return nullptr;
1004 return Range::Create(node->GetDocument(), node, marker->StartOffset(), node, 1005 return Range::Create(node->GetDocument(), node, marker->StartOffset(), node,
1005 marker->EndOffset()); 1006 marker->EndOffset());
1006 } 1007 }
1007 1008
1008 String Internals::markerDescriptionForNode(Node* node, 1009 String Internals::markerDescriptionForNode(Node* node,
1009 const String& marker_type, 1010 const String& marker_type,
1010 unsigned index, 1011 unsigned index,
1011 ExceptionState& exception_state) { 1012 ExceptionState& exception_state) {
1012 DocumentMarker* marker = MarkerAt(node, marker_type, index, exception_state); 1013 DocumentMarker* marker = MarkerAt(node, marker_type, index, exception_state);
1013 if (!marker) 1014 if (!marker || !IsSpellCheckMarker(*marker))
1014 return String(); 1015 return String();
1015 return marker->Description(); 1016 return ToSpellCheckMarker(marker)->Description();
1016 } 1017 }
1017 1018
1018 static WTF::Optional<TextMatchMarker::MatchStatus> MatchStatusFrom( 1019 static WTF::Optional<TextMatchMarker::MatchStatus> MatchStatusFrom(
1019 const String& match_status) { 1020 const String& match_status) {
1020 if (EqualIgnoringASCIICase(match_status, "kActive")) 1021 if (EqualIgnoringASCIICase(match_status, "kActive"))
1021 return TextMatchMarker::MatchStatus::kActive; 1022 return TextMatchMarker::MatchStatus::kActive;
1022 if (EqualIgnoringASCIICase(match_status, "kInactive")) 1023 if (EqualIgnoringASCIICase(match_status, "kInactive"))
1023 return TextMatchMarker::MatchStatus::kInactive; 1024 return TextMatchMarker::MatchStatus::kInactive;
1024 return WTF::nullopt; 1025 return WTF::nullopt;
1025 } 1026 }
(...skipping 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after
3290 3291
3291 void Internals::crash() { 3292 void Internals::crash() {
3292 CHECK(false) << "Intentional crash"; 3293 CHECK(false) << "Intentional crash";
3293 } 3294 }
3294 3295
3295 void Internals::setIsLowEndDevice(bool is_low_end_device) { 3296 void Internals::setIsLowEndDevice(bool is_low_end_device) {
3296 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); 3297 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device);
3297 } 3298 }
3298 3299
3299 } // namespace blink 3300 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698