Chromium Code Reviews| Index: chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc |
| diff --git a/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc b/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc |
| index c65f45776abd1f307fb212f88b6f297c6d6c13a0..a10acc16ac451cf7bc6c6c72784ff50a3d02c7e2 100644 |
| --- a/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc |
| +++ b/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc |
| @@ -170,13 +170,13 @@ TEST_F(UrlEmphasisTest, DangerousHttpsHost) { |
| EXPECT_CALL(mock_, SetColor(kDeemphasizedColor)); |
| EXPECT_CALL(mock_, ApplyColor(kEmphasizedColor, gfx::Range(8, 16))); |
| EXPECT_CALL(mock_, ApplyColor(kWarningColor, gfx::Range(0, 5))); |
| - EXPECT_CALL(mock_, ApplyStyle(gfx::TextStyle::DIAGONAL_STRIKE, true, |
| - gfx::Range(0, 5))); |
| + EXPECT_CALL(mock_, |
| + ApplyStyle(gfx::TextStyle::STRIKE, true, gfx::Range(0, 5))); |
| EXPECT_CALL(mock_, SetColor(kIncognitoDeemphasizedColor)); |
| EXPECT_CALL(mock_, ApplyColor(kIncognitoEmphasizedColor, gfx::Range(8, 16))); |
| EXPECT_CALL(mock_, ApplyColor(kIncognitoWarningColor, gfx::Range(0, 5))); |
| - EXPECT_CALL(mock_, ApplyStyle(gfx::TextStyle::DIAGONAL_STRIKE, true, |
| - gfx::Range(0, 5))); |
| + EXPECT_CALL(mock_, |
| + ApplyStyle(gfx::TextStyle::STRIKE, true, gfx::Range(0, 5))); |
| Verify("https://host.com/page", SecurityLevel::DANGEROUS, |
| "https://host.com/page"); |
| } |
| @@ -235,4 +235,24 @@ TEST(UrlBarTexture, LongPathsDoNotRequireElisionAndAreSupported) { |
| EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode()); |
| } |
| +#if defined(TEXTURE_DEBUGGING) |
| +TEST(UrlBarTexture, Visualize) { |
|
ymalik
2017/06/19 14:33:05
Did you mean to commit this?
cjgrant
2017/06/19 15:39:39
I meant to discuss whether we want example code ch
|
| + UrlBarTexture texture(false, base::Bind([](UiUnsupportedMode mode) {})); |
| + auto size = texture.GetPreferredTextureSize(512); |
| + |
| + SkBitmap bitmap; |
| + CHECK(bitmap.tryAllocN32Pixels(size.width(), size.height(), true)); |
| + SkCanvas canvas(bitmap); |
| + |
| + texture.SetURL( |
| + GURL(base::UTF8ToUTF16("https://www.cnn.com/happy-cats.html"))); |
| + texture.SetSecurityInfo(security_state::DANGEROUS, true); |
| + // texture.SetSecurityInfo(security_state::HTTP_SHOW_WARNING, false); |
| + texture.DrawAndLayout(&canvas, size); |
| + |
| + SkFILEWStream stream("texture.png"); |
| + SkEncodeImage(&stream, bitmap, SkEncodedImageFormat::kPNG, 100); |
| +} |
| +#endif |
| + |
| } // namespace vr_shell |