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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp

Issue 2627103003: [EditCommandSource] Pass source through |CompositeEditCommand| ctor instead of |apply(source)| (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
index 7eb43fef525ea114153f3faa311a43dad6fa53cd..28b0a71001780c9897063792beb6e23a93016c60 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
@@ -44,11 +44,10 @@ TEST_F(ReplaceSelectionCommandTest, pastingEmptySpan) {
ReplaceSelectionCommand::SanitizeFragment |
ReplaceSelectionCommand::SelectReplacement |
ReplaceSelectionCommand::SmartReplace;
- ReplaceSelectionCommand* command =
- ReplaceSelectionCommand::create(document(), fragment, options);
+ ReplaceSelectionCommand* command = ReplaceSelectionCommand::create(
+ document(), EditCommandSource::kMenuOrKeyBinding, fragment, options);
- EXPECT_TRUE(command->apply(EditCommandSource::kMenuOrKeyBinding))
- << "the replace command should have succeeded";
+ EXPECT_TRUE(command->apply()) << "the replace command should have succeeded";
EXPECT_EQ("foo", document().body()->innerHTML()) << "no DOM tree mutation";
}
@@ -68,11 +67,10 @@ TEST_F(ReplaceSelectionCommandTest, pasteSpanInText) {
fragment->parseHTML("<span><div>bar</div></span>", bElement);
ReplaceSelectionCommand::CommandOptions options = 0;
- ReplaceSelectionCommand* command =
- ReplaceSelectionCommand::create(document(), fragment, options);
+ ReplaceSelectionCommand* command = ReplaceSelectionCommand::create(
+ document(), EditCommandSource::kMenuOrKeyBinding, fragment, options);
- EXPECT_TRUE(command->apply(EditCommandSource::kMenuOrKeyBinding))
- << "the replace command should have succeeded";
+ EXPECT_TRUE(command->apply()) << "the replace command should have succeeded";
EXPECT_EQ("<b>t</b>bar<b>ext</b>", document().body()->innerHTML())
<< "'bar' should have been inserted";
}
@@ -93,10 +91,9 @@ TEST_F(ReplaceSelectionCommandTest, styleTagsInPastedHeadIncludedInContent) {
document().documentElement(), DisallowScriptingAndPluginContent);
ReplaceSelectionCommand::CommandOptions options = 0;
- ReplaceSelectionCommand* command =
- ReplaceSelectionCommand::create(document(), fragment, options);
- EXPECT_TRUE(command->apply(EditCommandSource::kMenuOrKeyBinding))
- << "the replace command should have succeeded";
+ ReplaceSelectionCommand* command = ReplaceSelectionCommand::create(
+ document(), EditCommandSource::kMenuOrKeyBinding, fragment, options);
+ EXPECT_TRUE(command->apply()) << "the replace command should have succeeded";
EXPECT_EQ(
"<head><style>foo { bar: baz; }</style></head>"

Powered by Google App Engine
This is Rietveld 408576698