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/HTMLFormControlElement.h" | 6 #include "core/html/HTMLFormControlElement.h" |
7 | 7 |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/html/HTMLDocument.h" | 9 #include "core/html/HTMLDocument.h" |
10 #include "core/html/HTMLInputElement.h" | 10 #include "core/html/HTMLInputElement.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 EXPECT_EQ(RTL, messageDir); | 60 EXPECT_EQ(RTL, messageDir); |
61 EXPECT_EQ(RTL, subMessageDir); | 61 EXPECT_EQ(RTL, subMessageDir); |
62 | 62 |
63 input->setCustomValidity(String::fromUTF8("Main message.")); | 63 input->setCustomValidity(String::fromUTF8("Main message.")); |
64 message = input->validationMessage().stripWhiteSpace(); | 64 message = input->validationMessage().stripWhiteSpace(); |
65 input->findCustomValidationMessageTextDirection(message, messageDir, subMess age, subMessageDir); | 65 input->findCustomValidationMessageTextDirection(message, messageDir, subMess age, subMessageDir); |
66 EXPECT_EQ(LTR, messageDir); | 66 EXPECT_EQ(LTR, messageDir); |
67 EXPECT_EQ(RTL, subMessageDir); | 67 EXPECT_EQ(RTL, subMessageDir); |
68 } | 68 } |
69 | 69 |
70 TEST_F(HTMLFormControlElementTest, isValidElement) | |
71 { | |
72 document().documentElement()->setInnerHTML("<body><input required id=input1> <input required id=input2 value=0></body>", ASSERT_NO_EXCEPTION); | |
73 document().view()->updateLayoutAndStyleIfNeededRecursive(); | |
74 | |
75 HTMLInputElement* input1 = toHTMLInputElement(document().getElementById("inp ut1")); | |
76 HTMLInputElement* input2 = toHTMLInputElement(document().getElementById("inp ut2")); | |
77 | |
78 EXPECT_FALSE(input1->isValidElement()); | |
79 EXPECT_TRUE(input2->isValidElement()); | |
keishi
2014/10/01 09:25:27
We don't need this test because this should alread
Bartek Nowierski
2014/10/02 14:26:43
Should I remove it? Or keep it since I already wro
keishi
2014/10/03 03:44:13
I don't think this adds any value, I think we shou
Bartek Nowierski
2014/10/03 06:01:33
Ok, removing this one and removing HTMLFormElement
| |
70 } | 80 } |
81 | |
82 } | |
OLD | NEW |