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

Side by Side Diff: Source/core/editing/EditingStrategyTest.cpp

Issue 1304363008: [Editing][CodeHealth] remove default argument 'host' in EditingTestBase::setShadowContent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 3 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
« no previous file with comments | « no previous file | Source/core/editing/EditingTestBase.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "config.h" 5 #include "config.h"
6 6
7 #include "core/editing/EditingStrategy.h" 7 #include "core/editing/EditingStrategy.h"
8 8
9 #include "core/editing/EditingTestBase.h" 9 #include "core/editing/EditingTestBase.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class EditingStrategyTest : public EditingTestBase { 13 class EditingStrategyTest : public EditingTestBase {
14 }; 14 };
15 15
16 TEST_F(EditingStrategyTest, caretMaxOffset) 16 TEST_F(EditingStrategyTest, caretMaxOffset)
17 { 17 {
18 const char* bodyContent = "<p id='host'>00<b id='one'>1</b><b id='two'>22</b >333</p>"; 18 const char* bodyContent = "<p id='host'>00<b id='one'>1</b><b id='two'>22</b >333</p>";
19 const char* shadowContent = "<content select=#two></content><content select= #one></content>"; 19 const char* shadowContent = "<content select=#two></content><content select= #one></content>";
20 setBodyContent(bodyContent); 20 setBodyContent(bodyContent);
21 setShadowContent(shadowContent); 21 setShadowContent(shadowContent, "host");
22 Node* host = document().getElementById("host"); 22 Node* host = document().getElementById("host");
23 Node* one = document().getElementById("one"); 23 Node* one = document().getElementById("one");
24 Node* two = document().getElementById("two"); 24 Node* two = document().getElementById("two");
25 25
26 EXPECT_EQ(4, EditingStrategy::caretMaxOffset(*host)); 26 EXPECT_EQ(4, EditingStrategy::caretMaxOffset(*host));
27 EXPECT_EQ(1, EditingStrategy::caretMaxOffset(*one)); 27 EXPECT_EQ(1, EditingStrategy::caretMaxOffset(*one));
28 EXPECT_EQ(1, EditingStrategy::caretMaxOffset(*one->firstChild())); 28 EXPECT_EQ(1, EditingStrategy::caretMaxOffset(*one->firstChild()));
29 EXPECT_EQ(2, EditingStrategy::caretMaxOffset(*two->firstChild())); 29 EXPECT_EQ(2, EditingStrategy::caretMaxOffset(*two->firstChild()));
30 30
31 EXPECT_EQ(2, EditingInComposedTreeStrategy::caretMaxOffset(*host)); 31 EXPECT_EQ(2, EditingInComposedTreeStrategy::caretMaxOffset(*host));
32 EXPECT_EQ(1, EditingInComposedTreeStrategy::caretMaxOffset(*one)); 32 EXPECT_EQ(1, EditingInComposedTreeStrategy::caretMaxOffset(*one));
33 EXPECT_EQ(1, EditingInComposedTreeStrategy::caretMaxOffset(*one->firstChild( ))); 33 EXPECT_EQ(1, EditingInComposedTreeStrategy::caretMaxOffset(*one->firstChild( )));
34 EXPECT_EQ(2, EditingInComposedTreeStrategy::caretMaxOffset(*two->firstChild( ))); 34 EXPECT_EQ(2, EditingInComposedTreeStrategy::caretMaxOffset(*two->firstChild( )));
35 } 35 }
36 36
37 } // namespace blink 37 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/EditingTestBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698