Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: third_party/WebKit/Source/core/dom/DocumentTest.cpp

Issue 2566523003: Fix meta-theme-color not working outside <head> (Closed)
Patch Set: Address comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b9f58385debb2a52ea91aa8beac730895e6a3874 100644
--- a/third_party/WebKit/Source/core/dom/DocumentTest.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
@@ -590,4 +590,25 @@ 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.");
tkent 2016/12/09 09:20:53 This sentence isn't necessary.
lpy 2016/12/09 17:53:37 Done.
+ EXPECT_EQ(Color(0, 255, 0), document().themeColor())
+ << "Theme color should be bright green.";
+ }
+
+ {
+ setHtmlInnerHTML(
+ "<body>"
+ "<meta name=\"theme-color\" content=\"#00ff00\">"
+ "Theme color should be bright green.");
tkent 2016/12/09 09:20:53 This sentence isn't necessary.
lpy 2016/12/09 17:53:37 Done.
+ EXPECT_EQ(Color(0, 255, 0), document().themeColor())
+ << "Theme color should be bright green.";
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698