| 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/HTMLSelectElement.h" | 5 #include "core/html/HTMLSelectElement.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/html/HTMLDocument.h" | 8 #include "core/html/HTMLDocument.h" |
| 9 #include "core/html/HTMLFormElement.h" | 9 #include "core/html/HTMLFormElement.h" |
| 10 #include "core/html/forms/FormController.h" | 10 #include "core/html/forms/FormController.h" |
| 11 #include "core/loader/EmptyClients.h" | 11 #include "core/loader/EmptyClients.h" |
| 12 #include "core/testing/DummyPageHolder.h" | 12 #include "core/testing/DummyPageHolder.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include <memory> | |
| 15 | 14 |
| 16 namespace blink { | 15 namespace blink { |
| 17 | 16 |
| 18 class HTMLSelectElementTest : public::testing::Test { | 17 class HTMLSelectElementTest : public::testing::Test { |
| 19 protected: | 18 protected: |
| 20 void SetUp() override; | 19 void SetUp() override; |
| 21 HTMLDocument& document() const { return *m_document; } | 20 HTMLDocument& document() const { return *m_document; } |
| 22 | 21 |
| 23 private: | 22 private: |
| 24 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; | 23 OwnPtr<DummyPageHolder> m_dummyPageHolder; |
| 25 Persistent<HTMLDocument> m_document; | 24 Persistent<HTMLDocument> m_document; |
| 26 }; | 25 }; |
| 27 | 26 |
| 28 void HTMLSelectElementTest::SetUp() | 27 void HTMLSelectElementTest::SetUp() |
| 29 { | 28 { |
| 30 Page::PageClients pageClients; | 29 Page::PageClients pageClients; |
| 31 fillWithEmptyClients(pageClients); | 30 fillWithEmptyClients(pageClients); |
| 32 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients)
; | 31 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients)
; |
| 33 | 32 |
| 34 m_document = toHTMLDocument(&m_dummyPageHolder->document()); | 33 m_document = toHTMLDocument(&m_dummyPageHolder->document()); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 EXPECT_EQ(select->defaultToolTip(), option->defaultToolTip()); | 334 EXPECT_EQ(select->defaultToolTip(), option->defaultToolTip()); |
| 336 EXPECT_EQ(select->defaultToolTip(), optgroup->defaultToolTip()); | 335 EXPECT_EQ(select->defaultToolTip(), optgroup->defaultToolTip()); |
| 337 | 336 |
| 338 option->remove(); | 337 option->remove(); |
| 339 optgroup->remove(); | 338 optgroup->remove(); |
| 340 EXPECT_EQ(String(), option->defaultToolTip()); | 339 EXPECT_EQ(String(), option->defaultToolTip()); |
| 341 EXPECT_EQ(String(), optgroup->defaultToolTip()); | 340 EXPECT_EQ(String(), optgroup->defaultToolTip()); |
| 342 } | 341 } |
| 343 | 342 |
| 344 } // namespace blink | 343 } // namespace blink |
| OLD | NEW |