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

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

Issue 2899393003: [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 bc380321c39edd6c02c6d81fc8ec94f8aa3fa9c6..0f1238e972aaab9e2fb7d365211d40fc0ae52251 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
@@ -152,4 +152,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

Powered by Google App Engine
This is Rietveld 408576698