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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp

Issue 1435773002: Show form validation message as a fallback tooltip. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 "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
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
OLDNEW
« no previous file with comments | « content/test/test_blink_web_unit_test_support.cc ('k') | third_party/WebKit/Source/core/html/forms/InputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698