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

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

Issue 110913005: Revert of Blend background with existing content (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | public/web/WebSettings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebViewTest.cpp
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
index 1b41785f937a1f88bc3a07d6ed1f0bc0df4084b2..edef35660abc1a0331298e823cd605bc98c2c566 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -58,15 +58,11 @@
#include "core/page/Chrome.h"
#include "core/page/Settings.h"
#include "core/platform/chromium/KeyboardCodes.h"
-#include "platform/graphics/Color.h"
#include "public/platform/Platform.h"
#include "public/platform/WebSize.h"
#include "public/platform/WebThread.h"
#include "public/platform/WebUnitTestSupport.h"
#include "public/web/WebWidgetClient.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/core/SkBitmapDevice.h"
-#include "third_party/skia/include/core/SkCanvas.h"
using namespace blink;
using blink::FrameTestHelpers::runPendingTasks;
@@ -276,35 +272,6 @@
// webView does not have a frame yet, but we should still be able to set the background color.
webView->setBaseBackgroundColor(kBlue);
EXPECT_EQ(kBlue, webView->backgroundColor());
-}
-
-TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent)
-{
- const WebColor kAlphaRed = 0x80FF0000;
- const WebColor kAlphaGreen = 0x8000FF00;
- const int kWidth = 100;
- const int kHeight = 100;
-
- // Set WebView background to green with alpha.
- WebView* webView = m_webViewHelper.initialize();
- webView->setBaseBackgroundColor(kAlphaGreen);
- webView->settings()->setShouldClearDocumentBackground(false);
- webView->resize(WebSize(kWidth, kHeight));
- webView->layout();
-
- // Set canvas background to red with alpha.
- SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, kWidth, kHeight);
- bitmap.allocPixels();
- SkBitmapDevice device(bitmap);
- SkCanvas canvas(&device);
- canvas.clear(kAlphaRed);
- webView->paint(&canvas, WebRect(0, 0, kWidth, kHeight));
-
- // The result should be a blend of red and green.
- uint32_t color = *bitmap.getAddr32(50, 50);
- EXPECT_TRUE(WebCore::redChannel(color));
- EXPECT_TRUE(WebCore::greenChannel(color));
}
TEST_F(WebViewTest, FocusIsInactive)
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | public/web/WebSettings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698