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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommandTest.cpp

Issue 2579253002: [EditCommandSource] Pass source to |CompositEditCommand| and |TypingCommand| (3/3) (Closed)
Patch Set: Created 4 years 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 // 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/commands/DeleteSelectionCommand.h" 5 #include "core/editing/commands/DeleteSelectionCommand.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/editing/EditingTestBase.h" 9 #include "core/editing/EditingTestBase.h"
10 #include "core/editing/FrameSelection.h" 10 #include "core/editing/FrameSelection.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 const bool kNoSmartDelete = false; 45 const bool kNoSmartDelete = false;
46 const bool kMergeBlocksAfterDelete = true; 46 const bool kMergeBlocksAfterDelete = true;
47 const bool kNoExpandForSpecialElements = false; 47 const bool kNoExpandForSpecialElements = false;
48 const bool kSanitizeMarkup = true; 48 const bool kSanitizeMarkup = true;
49 DeleteSelectionCommand* command = DeleteSelectionCommand::create( 49 DeleteSelectionCommand* command = DeleteSelectionCommand::create(
50 document(), kNoSmartDelete, kMergeBlocksAfterDelete, 50 document(), kNoSmartDelete, kMergeBlocksAfterDelete,
51 kNoExpandForSpecialElements, kSanitizeMarkup, 51 kNoExpandForSpecialElements, kSanitizeMarkup,
52 InputEvent::InputType::DeleteByCut); 52 InputEvent::InputType::DeleteByCut);
53 53
54 EXPECT_TRUE(command->apply()) << "the delete command should have succeeded"; 54 EXPECT_TRUE(command->apply(EditCommandSource::kMenuOrKeyBinding))
55 << "the delete command should have succeeded";
55 EXPECT_EQ("<div contenteditable=\"true\"><br></div>", 56 EXPECT_EQ("<div contenteditable=\"true\"><br></div>",
56 document().body()->innerHTML()); 57 document().body()->innerHTML());
57 EXPECT_TRUE(frame->selection().isCaret()); 58 EXPECT_TRUE(frame->selection().isCaret());
58 EXPECT_EQ(Position(div, 0), frame->selection().base().toOffsetInAnchor()); 59 EXPECT_EQ(Position(div, 0), frame->selection().base().toOffsetInAnchor());
59 } 60 }
60 61
61 } // namespace blink 62 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698