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/layout/LayoutTheme.h" | 5 #include "core/layout/LayoutTheme.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/NodeComputedStyle.h" | 8 #include "core/dom/NodeComputedStyle.h" |
9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/html/HTMLElement.h" | 10 #include "core/html/HTMLElement.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 void setHtmlInnerHTML(const char* htmlContent); | 25 void setHtmlInnerHTML(const char* htmlContent); |
26 | 26 |
27 private: | 27 private: |
28 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; | 28 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; |
29 Persistent<Document> m_document; | 29 Persistent<Document> m_document; |
30 }; | 30 }; |
31 | 31 |
32 void LayoutThemeTest::SetUp() { | 32 void LayoutThemeTest::SetUp() { |
33 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); | 33 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); |
34 m_document = &m_dummyPageHolder->document(); | 34 m_document = &m_dummyPageHolder->document(); |
35 ASSERT(m_document); | 35 DCHECK(m_document); |
36 } | 36 } |
37 | 37 |
38 void LayoutThemeTest::setHtmlInnerHTML(const char* htmlContent) { | 38 void LayoutThemeTest::setHtmlInnerHTML(const char* htmlContent) { |
39 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent)); | 39 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent)); |
40 document().view()->updateAllLifecyclePhases(); | 40 document().view()->updateAllLifecyclePhases(); |
41 } | 41 } |
42 | 42 |
43 inline Color outlineColor(Element* element) { | 43 inline Color outlineColor(Element* element) { |
44 return element->computedStyle()->visitedDependentColor( | 44 return element->computedStyle()->visitedDependentColor( |
45 CSSPropertyOutlineColor); | 45 CSSPropertyOutlineColor); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 }; | 96 }; |
97 | 97 |
98 for (const auto& testcase : tests) { | 98 for (const auto& testcase : tests) { |
99 EXPECT_EQ(testcase.expectedResult, | 99 EXPECT_EQ(testcase.expectedResult, |
100 LayoutTheme::theme().formatMediaControlsCurrentTime( | 100 LayoutTheme::theme().formatMediaControlsCurrentTime( |
101 testcase.time, testcase.duration)); | 101 testcase.time, testcase.duration)); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 } // namespace blink | 105 } // namespace blink |
OLD | NEW |