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

Side by Side Diff: third_party/WebKit/Source/core/events/EventPathTest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/events/EventPath.h" 5 #include "core/events/EventPath.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/PseudoElement.h" 9 #include "core/dom/PseudoElement.h"
10 #include "core/style/ComputedStyleConstants.h" 10 #include "core/style/ComputedStyleConstants.h"
11 #include "core/testing/DummyPageHolder.h" 11 #include "core/testing/DummyPageHolder.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include <memory>
14 13
15 namespace blink { 14 namespace blink {
16 15
17 class EventPathTest : public ::testing::Test { 16 class EventPathTest : public ::testing::Test {
18 protected: 17 protected:
19 Document& document() const { return m_dummyPageHolder->document(); } 18 Document& document() const { return m_dummyPageHolder->document(); }
20 19
21 private: 20 private:
22 void SetUp() override; 21 void SetUp() override;
23 22
24 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; 23 OwnPtr<DummyPageHolder> m_dummyPageHolder;
25 }; 24 };
26 25
27 void EventPathTest::SetUp() 26 void EventPathTest::SetUp()
28 { 27 {
29 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); 28 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
30 } 29 }
31 30
32 TEST_F(EventPathTest, ShouldBeEmptyForPseudoElementWithoutParentElement) 31 TEST_F(EventPathTest, ShouldBeEmptyForPseudoElementWithoutParentElement)
33 { 32 {
34 Element* div = document().createElement(HTMLNames::divTag, CreatedByCreateEl ement); 33 Element* div = document().createElement(HTMLNames::divTag, CreatedByCreateEl ement);
35 PseudoElement* pseudo = PseudoElement::create(div, PseudoIdFirstLetter); 34 PseudoElement* pseudo = PseudoElement::create(div, PseudoIdFirstLetter);
36 pseudo->dispose(); 35 pseudo->dispose();
37 EventPath eventPath(*pseudo); 36 EventPath eventPath(*pseudo);
38 EXPECT_TRUE(eventPath.isEmpty()); 37 EXPECT_TRUE(eventPath.isEmpty());
39 } 38 }
40 39
41 } // namespace blink 40 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/EventListenerMap.h ('k') | third_party/WebKit/Source/core/events/EventQueue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698