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