OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "core/html/HTMLInputElement.h" | 6 #include "core/html/HTMLInputElement.h" |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/html/HTMLBodyElement.h" | 9 #include "core/html/HTMLBodyElement.h" |
10 #include "core/html/HTMLHtmlElement.h" | 10 #include "core/html/HTMLHtmlElement.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 EXPECT_NE(nullptr, document.frameHost()); | 41 EXPECT_NE(nullptr, document.frameHost()); |
42 | 42 |
43 // Put the input element inside a document with frame. | 43 // Put the input element inside a document with frame. |
44 document.body()->appendChild(documentWithoutFrame->body()->firstChild()); | 44 document.body()->appendChild(documentWithoutFrame->body()->firstChild()); |
45 | 45 |
46 // Remove the input element and all refs to it so it gets deleted before the
document. | 46 // Remove the input element and all refs to it so it gets deleted before the
document. |
47 // The assert in |EventHandlerRegistry::updateEventHandlerTargets()| should
not be triggered. | 47 // The assert in |EventHandlerRegistry::updateEventHandlerTargets()| should
not be triggered. |
48 document.body()->removeChild(document.body()->firstChild()); | 48 document.body()->removeChild(document.body()->firstChild()); |
49 } | 49 } |
50 | 50 |
| 51 TEST(HTMLInputElementTest, DefaultToolTip) |
| 52 { |
| 53 RefPtrWillBeRawPtr<Document> document = Document::create(); |
| 54 RefPtrWillBeRawPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*document
); |
| 55 html->appendChild(HTMLBodyElement::create(*document)); |
| 56 RefPtrWillBeRawPtr<HTMLInputElement> input = HTMLInputElement::create(*docum
ent, nullptr, false); |
| 57 input->setBooleanAttribute(HTMLNames::requiredAttr, true); |
| 58 toHTMLBodyElement(html->firstChild())->appendChild(input.get()); |
| 59 document->appendChild(html.release()); |
| 60 EXPECT_EQ("<<ValidationValueMissing>>", input->defaultToolTip()); |
| 61 } |
| 62 |
51 } // namespace blink | 63 } // namespace blink |
OLD | NEW |