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

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

Issue 1171323003: Fix unit test style in core/{dom,editing,html}/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: whitespace fix Created 5 years, 6 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 | Annotate | Revision Log
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/CoreTestHelpers.h"
13 #include "core/testing/DummyPageHolder.h" 13 #include "core/testing/DummyPageHolder.h"
14 #include <gtest/gtest.h> 14 #include <gtest/gtest.h>
15 15
16 #define LOREM_IPSUM \ 16 #define LOREM_IPSUM \
17 "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 " \
18 "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 " \
19 "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 " \
20 "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." \
21 "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 " \
22 "mollit anim id est laborum." 22 "mollit anim id est laborum."
23 23
24 namespace blink { 24 namespace blink {
25 25
26 class VisibleSelectionTest : public ::testing::Test { 26 class VisibleSelectionTest : public ::testing::Test {
27 protected: 27 protected:
28 virtual void SetUp() override; 28 void SetUp() override;
29 29
30 Document& document() const { return m_dummyPageHolder->document(); } 30 Document& document() const { return m_dummyPageHolder->document(); }
31 31
32 static PassRefPtrWillBeRawPtr<ShadowRoot> createShadowRootForElementWithIDAn dSetInnerHTML(TreeScope&, const char* hostElementID, const char* shadowRootConte nt); 32 static PassRefPtrWillBeRawPtr<ShadowRoot> createShadowRootForElementWithIDAn dSetInnerHTML(TreeScope&, const char* hostElementID, const char* shadowRootConte nt);
33 33
34 void setBodyContent(const char*); 34 void setBodyContent(const char*);
35 PassRefPtrWillBeRawPtr<ShadowRoot> setShadowContent(const char*); 35 PassRefPtrWillBeRawPtr<ShadowRoot> setShadowContent(const char*);
36 36
37 // Helper function to set the VisibleSelection base/extent. 37 // Helper function to set the VisibleSelection base/extent.
38 void setSelection(VisibleSelection& selection, int base) { setSelection(sele ction, base, base); } 38 void setSelection(VisibleSelection& selection, int base) { setSelection(sele ction, base, base); }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 selection.expandUsingGranularity(WordGranularity); 239 selection.expandUsingGranularity(WordGranularity);
240 240
241 RefPtrWillBeRawPtr<Range> range = selection.firstRange(); 241 RefPtrWillBeRawPtr<Range> range = selection.firstRange();
242 EXPECT_EQ(0, range->startOffset()); 242 EXPECT_EQ(0, range->startOffset());
243 EXPECT_EQ(11, range->endOffset()); 243 EXPECT_EQ(11, range->endOffset());
244 EXPECT_EQ("Lorem ipsum", range->text()); 244 EXPECT_EQ("Lorem ipsum", range->text());
245 } 245 }
246 } 246 }
247 247
248 } // namespace blink 248 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/SurroundingTextTest.cpp ('k') | Source/core/editing/iterators/TextIteratorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698