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

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: 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 unified diff | Download patch
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 "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.
600 EXPECT_EQ(Color(0, 255, 0), document().themeColor())
601 << "Theme color should be bright green.";
602 }
603
604 {
605 setHtmlInnerHTML(
606 "<body>"
607 "<meta name=\"theme-color\" content=\"#00ff00\">"
608 "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.
609 EXPECT_EQ(Color(0, 255, 0), document().themeColor())
610 << "Theme color should be bright green.";
611 }
612 }
613
593 } // namespace blink 614 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698