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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 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
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 "core/editing/InputMethodController.h" 5 #include "core/editing/InputMethodController.h"
6 6
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/dom/Range.h" 8 #include "core/dom/Range.h"
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/events/MouseEvent.h" 10 #include "core/events/MouseEvent.h"
11 #include "core/frame/FrameView.h" 11 #include "core/frame/FrameView.h"
12 #include "core/frame/LocalFrame.h" 12 #include "core/frame/LocalFrame.h"
13 #include "core/frame/Settings.h" 13 #include "core/frame/Settings.h"
14 #include "core/html/HTMLDocument.h" 14 #include "core/html/HTMLDocument.h"
15 #include "core/html/HTMLInputElement.h" 15 #include "core/html/HTMLInputElement.h"
16 #include "core/testing/DummyPageHolder.h" 16 #include "core/testing/DummyPageHolder.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include <memory>
18 19
19 namespace blink { 20 namespace blink {
20 21
21 class InputMethodControllerTest : public ::testing::Test { 22 class InputMethodControllerTest : public ::testing::Test {
22 protected: 23 protected:
23 InputMethodController& controller() { return frame().inputMethodController() ; } 24 InputMethodController& controller() { return frame().inputMethodController() ; }
24 HTMLDocument& document() const { return *m_document; } 25 HTMLDocument& document() const { return *m_document; }
25 LocalFrame& frame() const { return m_dummyPageHolder->frame(); } 26 LocalFrame& frame() const { return m_dummyPageHolder->frame(); }
26 Element* insertHTMLElement(const char* elementCode, const char* elementId); 27 Element* insertHTMLElement(const char* elementCode, const char* elementId);
27 28
28 private: 29 private:
29 void SetUp() override; 30 void SetUp() override;
30 31
31 OwnPtr<DummyPageHolder> m_dummyPageHolder; 32 std::unique_ptr<DummyPageHolder> m_dummyPageHolder;
32 Persistent<HTMLDocument> m_document; 33 Persistent<HTMLDocument> m_document;
33 }; 34 };
34 35
35 void InputMethodControllerTest::SetUp() 36 void InputMethodControllerTest::SetUp()
36 { 37 {
37 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); 38 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
38 m_document = toHTMLDocument(&m_dummyPageHolder->document()); 39 m_document = toHTMLDocument(&m_dummyPageHolder->document());
39 DCHECK(m_document); 40 DCHECK(m_document);
40 } 41 }
41 42
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 controller().setComposition("foo", underlines, 0, 3); 371 controller().setComposition("foo", underlines, 0, 3);
371 EXPECT_STREQ("beforeinput.isComposing:true", document().title().utf8().data( )); 372 EXPECT_STREQ("beforeinput.isComposing:true", document().title().utf8().data( ));
372 373
373 document().setTitle(emptyString()); 374 document().setTitle(emptyString());
374 controller().confirmComposition(); 375 controller().confirmComposition();
375 // Last 'beforeinput' should also be inside composition scope. 376 // Last 'beforeinput' should also be inside composition scope.
376 EXPECT_STREQ("beforeinput.isComposing:true", document().title().utf8().data( )); 377 EXPECT_STREQ("beforeinput.isComposing:true", document().title().utf8().data( ));
377 } 378 }
378 379
379 } // namespace blink 380 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698