Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLAnchorElementTest.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElementTest.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..84f19705ad4ac7f9be91b8e2dc22af2d3e621a96 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/html/HTMLAnchorElementTest.cpp |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
tkent
2016/03/14 00:06:33
2014 -> 2016
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/html/HTMLAnchorElement.h" |
| + |
| +#include "core/dom/Document.h" |
| +#include "core/events/Event.h" |
| +#include "core/events/MouseEvent.h" |
| +#include "core/testing/DummyPageHolder.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace blink { |
| + |
| +TEST(HTMLAnchorElementTest, getClampedPointFromEventWithNull) |
| +{ |
| + IntPoint clampedPoint; |
| + bool success = HTMLAnchorElement::getClampedPointFromEvent(clampedPoint, nullptr); |
| + EXPECT_EQ(success, false); |
| +} |
| + |
| +TEST(HTMLAnchorElementTest, getClampedPointFromEventWithEmptyMouseEvent) |
| +{ |
| + IntPoint clampedPoint; |
| + RefPtrWillBeRawPtr<MouseEvent> event = MouseEvent::create(); |
| + bool success = HTMLAnchorElement::getClampedPointFromEvent(clampedPoint, event); |
| + EXPECT_EQ(success, false); |
| +} |
| + |
| +TEST(HTMLAnchorElementTest, appendServerMapMousePosition) |
| +{ |
| + StringBuilder url; |
| + IntPoint clampedPoint(20, 20); |
| + HTMLAnchorElement::appendServerMapMousePosition(url, clampedPoint); |
| + EXPECT_EQ(url.toString(), "?20,20"); |
| +} |
| + |
| +} // namespace blink |