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

Side by Side Diff: Source/core/editing/InputMethodControllerTest.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/InputMethodController.h" 6 #include "core/editing/InputMethodController.h"
7 7
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/dom/Range.h" 9 #include "core/dom/Range.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
11 #include "core/html/HTMLDocument.h" 11 #include "core/html/HTMLDocument.h"
12 #include "core/html/HTMLInputElement.h" 12 #include "core/html/HTMLInputElement.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 using namespace blink; 16 namespace blink {
17
18 namespace {
19 17
20 class InputMethodControllerTest : public ::testing::Test { 18 class InputMethodControllerTest : public ::testing::Test {
21 protected: 19 protected:
22 InputMethodController& controller() { return frame().inputMethodController() ; } 20 InputMethodController& controller() { return frame().inputMethodController() ; }
23 HTMLDocument& document() const { return *m_document; } 21 HTMLDocument& document() const { return *m_document; }
24 LocalFrame& frame() const { return m_dummyPageHolder->frame(); } 22 LocalFrame& frame() const { return m_dummyPageHolder->frame(); }
25 Element* insertHTMLElement(const char* elementCode, const char* elementId); 23 Element* insertHTMLElement(const char* elementCode, const char* elementId);
26 24
27 private: 25 private:
28 virtual void SetUp() override; 26 void SetUp() override;
29 27
30 OwnPtr<DummyPageHolder> m_dummyPageHolder; 28 OwnPtr<DummyPageHolder> m_dummyPageHolder;
31 HTMLDocument* m_document; 29 HTMLDocument* m_document;
32 }; 30 };
33 31
34 void InputMethodControllerTest::SetUp() 32 void InputMethodControllerTest::SetUp()
35 { 33 {
36 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); 34 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
37 m_document = toHTMLDocument(&m_dummyPageHolder->document()); 35 m_document = toHTMLDocument(&m_dummyPageHolder->document());
38 ASSERT(m_document); 36 ASSERT(m_document);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 { 130 {
133 insertHTMLElement("<div id='sample' contenteditable='true'>test</div>", "sam ple"); 131 insertHTMLElement("<div id='sample' contenteditable='true'>test</div>", "sam ple");
134 132
135 Vector<CompositionUnderline> underlines; 133 Vector<CompositionUnderline> underlines;
136 underlines.append(CompositionUnderline(7, 8, Color(255, 0, 0), false, 0)); 134 underlines.append(CompositionUnderline(7, 8, Color(255, 0, 0), false, 0));
137 controller().setCompositionFromExistingText(underlines, 7, 8); 135 controller().setCompositionFromExistingText(underlines, 7, 8);
138 136
139 EXPECT_FALSE(controller().compositionRange()); 137 EXPECT_FALSE(controller().compositionRange());
140 } 138 }
141 139
142 } // namespace 140 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/GranularityStrategyTest.cpp ('k') | Source/core/editing/StyledMarkupSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698