| Index: third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommandTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommandTest.cpp b/third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommandTest.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..72dc6ad199b575e7df8fbab1167386e887a984d4
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommandTest.cpp
|
| @@ -0,0 +1,29 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "core/editing/commands/SetCharacterDataCommand.h"
|
| +
|
| +#include "core/editing/EditingTestBase.h"
|
| +#include "core/editing/commands/EditingState.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class SetCharacterDataCommandTest : public EditingTestBase {};
|
| +
|
| +TEST_F(SetCharacterDataCommandTest, applyAndUnapply) {
|
| + setBodyContent("<div contenteditable>This is a good test case</div>");
|
| +
|
| + SetCharacterDataCommand* command = SetCharacterDataCommand::create(
|
| + toText(document().body()->firstChild()->firstChild()), 10, 4, "lousy");
|
| +
|
| + command->doReapply();
|
| + EXPECT_EQ("This is a lousy test case",
|
| + toText(document().body()->firstChild()->firstChild())->wholeText());
|
| +
|
| + command->doUnapply();
|
| + EXPECT_EQ("This is a good test case",
|
| + toText(document().body()->firstChild()->firstChild())->wholeText());
|
| +}
|
| +
|
| +} // namespace blink
|
|
|