Commit f415c1a3 authored by eseckler's avatar eseckler Committed by Commit bot

Reenables the CaptureScreenshot test for mac and msan builds. Also adds

checks for an additional pixel to help triage in case this regresses again.

BUG=430620,423583

Review-Url: https://codereview.chromium.org/2247313002
Cr-Commit-Position: refs/heads/master@{#412485}
parent 762478d1
...@@ -377,17 +377,8 @@ class CaptureScreenshotTest : public DevToolsProtocolTest { ...@@ -377,17 +377,8 @@ class CaptureScreenshotTest : public DevToolsProtocolTest {
}; };
// Does not link on Android // Does not link on Android
#if defined(OS_ANDROID) #if !defined(OS_ANDROID)
#define MAYBE_CaptureScreenshot DISABLED_CaptureScreenshot IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, CaptureScreenshot) {
#elif defined(OS_MACOSX) // Fails on 10.9. http://crbug.com/430620
#define MAYBE_CaptureScreenshot DISABLED_CaptureScreenshot
#elif defined(MEMORY_SANITIZER)
// Also fails under MSAN. http://crbug.com/423583
#define MAYBE_CaptureScreenshot DISABLED_CaptureScreenshot
#else
#define MAYBE_CaptureScreenshot CaptureScreenshot
#endif
IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, MAYBE_CaptureScreenshot) {
shell()->LoadURL(GURL("about:blank")); shell()->LoadURL(GURL("about:blank"));
Attach(); Attach();
EXPECT_TRUE(content::ExecuteScript( EXPECT_TRUE(content::ExecuteScript(
...@@ -402,10 +393,15 @@ IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, MAYBE_CaptureScreenshot) { ...@@ -402,10 +393,15 @@ IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, MAYBE_CaptureScreenshot) {
gfx::PNGCodec::Decode(reinterpret_cast<const unsigned char*>(png.data()), gfx::PNGCodec::Decode(reinterpret_cast<const unsigned char*>(png.data()),
png.size(), &bitmap); png.size(), &bitmap);
SkColor color(bitmap.getColor(0, 0)); SkColor color(bitmap.getColor(0, 0));
EXPECT_TRUE(std::abs(0x12-(int)SkColorGetR(color)) <= 1); EXPECT_GE(1, std::abs(0x12-(int)SkColorGetR(color)));
EXPECT_TRUE(std::abs(0x34-(int)SkColorGetG(color)) <= 1); EXPECT_GE(1, std::abs(0x34-(int)SkColorGetG(color)));
EXPECT_TRUE(std::abs(0x56-(int)SkColorGetB(color)) <= 1); EXPECT_GE(1, std::abs(0x56-(int)SkColorGetB(color)));
color = bitmap.getColor(1, 1);
EXPECT_GE(1, std::abs(0x12-(int)SkColorGetR(color)));
EXPECT_GE(1, std::abs(0x34-(int)SkColorGetG(color)));
EXPECT_GE(1, std::abs(0x56-(int)SkColorGetB(color)));
} }
#endif
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// Disabled, see http://crbug.com/469947. // Disabled, see http://crbug.com/469947.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment