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

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

Issue 2912093002: [vr] Exit VR mode when we encounter unsupported URLs (Closed)
Patch Set: Created 3 years, 7 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 c44f4cd991c337c4d130027639ca75a75744685a..c89c31020514940e915a373aefdf4453b0248262 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
@@ -177,4 +177,30 @@ TEST(UrlBarTextureTest, WillFailOnUnhandledCodePoint) {
EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode());
}
+TEST(UrlBarTexture, ElisionIsAnUnsupportedMode) {
+ TestUrlBarTexture texture;
+ texture.DrawURL(GURL(
+ "https://"
+ "thereisnopossiblewaythatthishostnamecouldbecontainedinthelimitedspacetha"
+ "tweareaffordedtousitsreallynotsomethingweshouldconsiderorplanfororpinour"
+ "hopesonlestwegetdisappointedor.sad.com"));
+ EXPECT_EQ(UiUnsupportedMode::kCouldNotElideURL, texture.unsupported_mode());
+}
+
+TEST(UrlBarTexture, ShortURLAreIndeedSupported) {
+ TestUrlBarTexture texture;
+ texture.DrawURL(GURL("https://short.com/"));
+ EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode());
+}
+
+TEST(UrlBarTexture, LongPathsDoNotRequireElisionAndAreSupported) {
+ TestUrlBarTexture texture;
+ texture.DrawURL(GURL(
+ "https://something.com/"
+ "thereisnopossiblewaythatthishostnamecouldbecontainedinthelimitedspacetha"
+ "tweareaffordedtousitsreallynotsomethingweshouldconsiderorplanfororpinour"
+ "hopesonlestwegetdisappointedorsad.com"));
+ EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode());
+}
+
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/textures/url_bar_texture.cc ('k') | chrome/browser/android/vr_shell/ui_unsupported_mode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698