Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/DocumentTest.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/DocumentTest.cpp b/third_party/WebKit/Source/core/dom/DocumentTest.cpp |
| index 5aa5712de737645acf67a4b34b684311e9ad3aff..2d10ccc1f242fe7af1f6b7da4445c555e89670d7 100644 |
| --- a/third_party/WebKit/Source/core/dom/DocumentTest.cpp |
| +++ b/third_party/WebKit/Source/core/dom/DocumentTest.cpp |
| @@ -590,4 +590,29 @@ TEST_F(DocumentTest, SynchronousMutationNotifierUpdateCharacterData) { |
| EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_newLength, 3u); |
| } |
| +// This tests that meta-theme-color can be found correctly |
| +TEST_F(DocumentTest, ThemeColor) { |
| + { |
| + setHtmlInnerHTML( |
| + "<meta name=\"theme-color\" content=\"#00ff00\">" |
| + "<body>" |
| + "Theme color should be bright green."); |
| + auto themeColor = document().themeColor(); |
| + EXPECT_EQ(themeColor.red(), 0); |
|
tkent
2016/12/09 08:48:38
The first argument should be an expected value.
Al
lpy
2016/12/09 09:17:37
Done.
|
| + EXPECT_EQ(themeColor.green(), 255); |
| + EXPECT_EQ(themeColor.blue(), 0); |
| + } |
| + |
| + { |
| + setHtmlInnerHTML( |
| + "<body>" |
| + "<meta name=\"theme-color\" content=\"#00ff00\">" |
| + "Theme color should be bright green."); |
| + auto themeColor = document().themeColor(); |
| + EXPECT_EQ(themeColor.red(), 0); |
| + EXPECT_EQ(themeColor.green(), 255); |
| + EXPECT_EQ(themeColor.blue(), 0); |
| + } |
| +} |
| + |
| } // namespace blink |