OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 5530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5541 EXPECT_EQ(40, dragImage->size().height()); | 5541 EXPECT_EQ(40, dragImage->size().height()); |
5542 const SkBitmap& dragBitmap = dragImage->bitmap(); | 5542 const SkBitmap& dragBitmap = dragImage->bitmap(); |
5543 SkAutoLockPixels lockPixel(dragBitmap); | 5543 SkAutoLockPixels lockPixel(dragBitmap); |
5544 EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSi ze())); | 5544 EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSi ze())); |
5545 } | 5545 } |
5546 | 5546 |
5547 class BrandColorTestWebFrameClient : public FrameTestHelpers::TestWebFrameClient { | 5547 class BrandColorTestWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
5548 public: | 5548 public: |
5549 BrandColorTestWebFrameClient() | 5549 BrandColorTestWebFrameClient() |
5550 : m_didNotify(false) | 5550 : m_didNotify(false) |
5551 , m_brandColor(0) | |
5552 { | 5551 { |
5553 } | 5552 } |
5554 | 5553 |
5555 bool didNotify() const | 5554 bool didNotify() const |
5556 { | 5555 { |
5557 return m_didNotify; | 5556 return m_didNotify; |
5558 } | 5557 } |
5559 | 5558 |
5560 WebColor brandColor() const | |
5561 { | |
5562 return m_brandColor; | |
5563 } | |
5564 | |
5565 private: | 5559 private: |
5566 virtual void didChangeBrandColor(WebLocalFrame* webLocalFrame) | 5560 virtual void didChangeBrandColor() |
5567 { | 5561 { |
5568 m_didNotify = true; | 5562 m_didNotify = true; |
5569 m_brandColor = webLocalFrame->document().brandColor(); | |
5570 } | 5563 } |
5571 | 5564 |
5572 bool m_didNotify; | 5565 bool m_didNotify; |
5573 WebColor m_brandColor; | |
5574 }; | 5566 }; |
5575 | 5567 |
5576 TEST_F(WebFrameTest, BrandColor) | 5568 TEST_F(WebFrameTest, BrandColor) |
5577 { | 5569 { |
5578 registerMockedHttpURLLoad("brand_color_test.html"); | 5570 registerMockedHttpURLLoad("brand_color_test.html"); |
5579 FrameTestHelpers::WebViewHelper webViewHelper; | 5571 FrameTestHelpers::WebViewHelper webViewHelper; |
5580 BrandColorTestWebFrameClient client; | 5572 BrandColorTestWebFrameClient client; |
5581 webViewHelper.initializeAndLoad(m_baseURL + "brand_color_test.html", false, &client); | 5573 webViewHelper.initializeAndLoad(m_baseURL + "brand_color_test.html", false, &client); |
5582 EXPECT_TRUE(client.didNotify()); | 5574 EXPECT_TRUE(client.didNotify()); |
5583 EXPECT_EQ(0xff0000ff, client.brandColor()); | 5575 EXPECT_EQ(0xff0000ff, webViewHelper.webView()->mainFrame()->document().brand Color()); |
dcheng
2014/06/17 16:51:55
The site isolation team hasn't had enough cycles t
michaelbai
2014/06/17 17:06:08
Done.
Is there any document about how to add web
| |
5584 } | 5576 } |
5585 | 5577 |
5586 } // namespace | 5578 } // namespace |
OLD | NEW |