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

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

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

Powered by Google App Engine
This is Rietveld 408576698