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

Unified Diff: Source/web/tests/WebFrameTest.cpp

Issue 329943004: Implementation of brand-color (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months 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: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 786e119f528bee9b74d0cd8ec830c0158d3b9c08..830d9928c6c710aa8d795e701e09fd5bd8c1c5d3 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -5544,4 +5544,43 @@ TEST_F(WebFrameTest, NodeImageTestCSS3DTransform)
EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSize()));
}
+class BrandColorTestWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
+public:
+ BrandColorTestWebFrameClient()
+ : m_didNotify(false)
+ , m_brandColor(0)
+ {
+ }
+
+ bool didNotify() const
+ {
+ return m_didNotify;
+ }
+
+ WebColor brandColor() const
+ {
+ return m_brandColor;
+ }
+
+private:
+ virtual void didChangeBrandColor(WebLocalFrame* webLocalFrame)
+ {
+ m_didNotify = true;
+ m_brandColor = webLocalFrame->document().brandColor();
+ }
+
+ bool m_didNotify;
+ WebColor m_brandColor;
+};
+
+TEST_F(WebFrameTest, BrandColor)
+{
+ registerMockedHttpURLLoad("brand_color_test.html");
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ BrandColorTestWebFrameClient client;
+ webViewHelper.initializeAndLoad(m_baseURL + "brand_color_test.html", false, &client);
+ EXPECT_TRUE(client.didNotify());
+ EXPECT_EQ(0xff0000ff, client.brandColor());
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698