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
3 // found in the LICENSE file.
6 #include "core/events/EventPath.h"
8 #include "core/HTMLNames.h"
9 #include "core/dom/Document.h"
10 #include "core/dom/PseudoElement.h"
11 #include "core/style/ComputedStyleConstants.h"
12 #include "core/testing/DummyPageHolder.h"
13 #include <gtest/gtest.h>
17 class EventPathTest
: public ::testing::Test
{
19 Document
& document() const { return m_dummyPageHolder
->document(); }
22 void SetUp() override
;
24 OwnPtr
<DummyPageHolder
> m_dummyPageHolder
;
27 void EventPathTest::SetUp()
29 m_dummyPageHolder
= DummyPageHolder::create(IntSize(800, 600));
32 TEST_F(EventPathTest
, ShouldBeEmptyForPseudoElementWithoutParentElement
)
34 RefPtrWillBeRawPtr
<Element
> div
= document().createElement(HTMLNames::divTag
, false);
35 RefPtrWillBeRawPtr
<PseudoElement
> pseudo
= PseudoElement::create(div
.get(), FIRST_LETTER
);
37 EventPath
eventPath(*pseudo
);
38 EXPECT_TRUE(eventPath
.isEmpty());