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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentTest.cpp

Issue 2566523003: Fix meta-theme-color not working outside <head> (Closed)
Patch Set: update 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 EXPECT_EQ(observer.updatedCharacterDataRecords()[2]->m_newLength, 3u); 583 EXPECT_EQ(observer.updatedCharacterDataRecords()[2]->m_newLength, 3u);
584 584
585 replaceSample->replaceData(6, 4, "ghi", ASSERT_NO_EXCEPTION); 585 replaceSample->replaceData(6, 4, "ghi", ASSERT_NO_EXCEPTION);
586 ASSERT_EQ(observer.updatedCharacterDataRecords().size(), 4u); 586 ASSERT_EQ(observer.updatedCharacterDataRecords().size(), 4u);
587 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_node, replaceSample); 587 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_node, replaceSample);
588 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_offset, 6u); 588 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_offset, 6u);
589 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_oldLength, 4u); 589 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_oldLength, 4u);
590 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_newLength, 3u); 590 EXPECT_EQ(observer.updatedCharacterDataRecords()[3]->m_newLength, 3u);
591 } 591 }
592 592
593 // This tests that meta-theme-color can be found correctly
594 TEST_F(DocumentTest, ThemeColor) {
595 {
596 setHtmlInnerHTML(
597 "<meta name=\"theme-color\" content=\"#00ff00\">"
598 "<body>");
599 EXPECT_EQ(Color(0, 255, 0), document().themeColor())
600 << "Theme color should be bright green.";
601 }
602
603 {
604 setHtmlInnerHTML(
605 "<body>"
606 "<meta name=\"theme-color\" content=\"#00ff00\">");
607 EXPECT_EQ(Color(0, 255, 0), document().themeColor())
608 << "Theme color should be bright green.";
609 }
610 }
611
593 } // namespace blink 612 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698