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 "core/html/HTMLFormControlElement.h" | 5 #include "core/html/HTMLFormControlElement.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/LocalFrameView.h" | 9 #include "core/frame/LocalFrameView.h" |
10 #include "core/html/HTMLInputElement.h" | 10 #include "core/html/HTMLInputElement.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 void DocumentDetached(const Document&) override {} | 45 void DocumentDetached(const Document&) override {} |
46 void WillBeDestroyed() override {} | 46 void WillBeDestroyed() override {} |
47 DEFINE_INLINE_VIRTUAL_TRACE() { | 47 DEFINE_INLINE_VIRTUAL_TRACE() { |
48 visitor->Trace(anchor_); | 48 visitor->Trace(anchor_); |
49 ValidationMessageClient::Trace(visitor); | 49 ValidationMessageClient::Trace(visitor); |
50 } | 50 } |
51 | 51 |
52 private: | 52 private: |
53 Member<const Element> anchor_; | 53 Member<const Element> anchor_; |
54 }; | 54 }; |
55 } | 55 } // namespace |
56 | 56 |
57 class HTMLFormControlElementTest : public ::testing::Test { | 57 class HTMLFormControlElementTest : public ::testing::Test { |
58 protected: | 58 protected: |
59 void SetUp() override; | 59 void SetUp() override; |
60 | 60 |
61 Page& GetPage() const { return dummy_page_holder_->GetPage(); } | 61 Page& GetPage() const { return dummy_page_holder_->GetPage(); } |
62 Document& GetDocument() const { return *document_; } | 62 Document& GetDocument() const { return *document_; } |
63 | 63 |
64 private: | 64 private: |
65 std::unique_ptr<DummyPageHolder> dummy_page_holder_; | 65 std::unique_ptr<DummyPageHolder> dummy_page_holder_; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 Page::OrdinaryPages().insert(&GetPage()); | 133 Page::OrdinaryPages().insert(&GetPage()); |
134 | 134 |
135 HTMLInputElement* input = | 135 HTMLInputElement* input = |
136 toHTMLInputElement(GetDocument().getElementById("input")); | 136 toHTMLInputElement(GetDocument().getElementById("input")); |
137 ScopedPageSuspender suspender; // print() suspends the page. | 137 ScopedPageSuspender suspender; // print() suspends the page. |
138 input->reportValidity(); | 138 input->reportValidity(); |
139 EXPECT_FALSE(validation_message_client->IsValidationMessageVisible(*input)); | 139 EXPECT_FALSE(validation_message_client->IsValidationMessageVisible(*input)); |
140 } | 140 } |
141 | 141 |
142 } // namespace blink | 142 } // namespace blink |
OLD | NEW |