OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/editing/state_machines/StateMachineTestUtil.h" | 5 #include "core/editing/state_machines/StateMachineTestUtil.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include "core/editing/state_machines/BackwardGraphemeBoundaryStateMachine.h" | 8 #include "core/editing/state_machines/BackwardGraphemeBoundaryStateMachine.h" |
8 #include "core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.h" | 9 #include "core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.h" |
9 #include "core/editing/state_machines/TextSegmentationMachineState.h" | 10 #include "core/editing/state_machines/TextSegmentationMachineState.h" |
10 #include "wtf/Assertions.h" | 11 #include "wtf/Assertions.h" |
11 #include "wtf/text/StringBuilder.h" | 12 #include "wtf/text/StringBuilder.h" |
12 #include <algorithm> | |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 namespace { | 16 namespace { |
17 char MachineStateToChar(TextSegmentationMachineState state) { | 17 char MachineStateToChar(TextSegmentationMachineState state) { |
18 static const char indicators[] = { | 18 static const char indicators[] = { |
19 'I', // Invalid | 19 'I', // Invalid |
20 'R', // NeedMoreCodeUnit (Repeat) | 20 'R', // NeedMoreCodeUnit (Repeat) |
21 'S', // NeedFollowingCodeUnit (Switch) | 21 'S', // NeedFollowingCodeUnit (Switch) |
22 'F', // Finished | 22 'F', // Finished |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const Vector<UChar32>& preceding, | 103 const Vector<UChar32>& preceding, |
104 const Vector<UChar32>& following) { | 104 const Vector<UChar32>& following) { |
105 const String& out = processSequence(machine, preceding, following); | 105 const String& out = processSequence(machine, preceding, following); |
106 if (machine->finalizeAndGetBoundaryOffset() != | 106 if (machine->finalizeAndGetBoundaryOffset() != |
107 machine->finalizeAndGetBoundaryOffset()) | 107 machine->finalizeAndGetBoundaryOffset()) |
108 return "State machine changes final offset after finished."; | 108 return "State machine changes final offset after finished."; |
109 return out; | 109 return out; |
110 } | 110 } |
111 | 111 |
112 } // namespace blink | 112 } // namespace blink |
OLD | NEW |