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

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

Issue 1105333002: Introduce printers for Node and Position for ease of developing GTest test files (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "core/editing/VisibleSelection.h" 6 #include "core/editing/VisibleSelection.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Range.h" 9 #include "core/dom/Range.h"
10 #include "core/dom/Text.h" 10 #include "core/dom/Text.h"
11 #include "core/html/HTMLElement.h" 11 #include "core/html/HTMLElement.h"
12 #include "core/testing/CoreTestHelpers.h"
12 #include "core/testing/DummyPageHolder.h" 13 #include "core/testing/DummyPageHolder.h"
13 #include <gtest/gtest.h> 14 #include <gtest/gtest.h>
14 15
15 #define LOREM_IPSUM \ 16 #define LOREM_IPSUM \
16 "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod te mpor " \ 17 "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod te mpor " \
17 "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud " \ 18 "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud " \
18 "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure " \ 19 "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure " \
19 "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat null a pariatur." \ 20 "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat null a pariatur." \
20 "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia d eserunt " \ 21 "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia d eserunt " \
21 "mollit anim id est laborum." 22 "mollit anim id est laborum."
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 selection.expandUsingGranularity(WordGranularity); 239 selection.expandUsingGranularity(WordGranularity);
239 240
240 RefPtrWillBeRawPtr<Range> range = selection.firstRange(); 241 RefPtrWillBeRawPtr<Range> range = selection.firstRange();
241 EXPECT_EQ(0, range->startOffset()); 242 EXPECT_EQ(0, range->startOffset());
242 EXPECT_EQ(11, range->endOffset()); 243 EXPECT_EQ(11, range->endOffset());
243 EXPECT_EQ("Lorem ipsum", range->text()); 244 EXPECT_EQ("Lorem ipsum", range->text());
244 } 245 }
245 } 246 }
246 247
247 } // namespace blink 248 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698