| Index: Source/web/tests/WebFrameTest.cpp
|
| diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
|
| index b0fdef8e6bd66b00cd63cdd97ed88eed4ba6fd7b..aa97516135ea5ad371359b2e32cefbc427ffed72 100644
|
| --- a/Source/web/tests/WebFrameTest.cpp
|
| +++ b/Source/web/tests/WebFrameTest.cpp
|
| @@ -5540,4 +5540,44 @@ 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;
|
| + WebCore::RuntimeEnabledFeatures::setBrandColorEnabled(true);
|
| + webViewHelper.initializeAndLoad(m_baseURL + "brand_color_test.html", false, &client);
|
| + EXPECT_TRUE(client.didNotify());
|
| + EXPECT_EQ(0xff0000ff, client.brandColor());
|
| +}
|
| +
|
| } // namespace
|
|
|