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

Unified Diff: chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc

Issue 2946523002: VR: Support security chip text on URL bar. (Closed)
Patch Set: Created 3 years, 6 months 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
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

Powered by Google App Engine
This is Rietveld 408576698