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 01709d451131a62997ee065d9278c5c9e96312b9..69f9f1faf999e3df13a717a9faba7d1cfd291ffd 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 |
| @@ -9,7 +9,9 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "chrome/browser/android/vr_shell/textures/render_text_wrapper.h" |
| +#include "chrome/browser/android/vr_shell/toolbar_state.h" |
| #include "components/security_state/core/security_state.h" |
| +#include "components/toolbar/vector_icons.h" |
| #include "components/url_formatter/url_formatter.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -44,7 +46,12 @@ class TestUrlBarTexture : public UrlBarTexture { |
| void DrawURL(const GURL& gurl) { |
| unsupported_mode_ = UiUnsupportedMode::kCount; |
| - SetURL(gurl); |
| + ToolbarState state; |
|
mthiesse
2017/06/28 00:27:08
Why not just add a 5-param constructor to ToolbarS
cjgrant
2017/06/28 15:14:33
Done.
|
| + state.gurl = gurl; |
| + state.vector_icon = &toolbar::kHttpIcon; |
| + state.security_level = SecurityLevel::HTTP_SHOW_WARNING; |
| + ASSERT_TRUE(state.should_display_url); |
| + SetToolbarState(state); |
| sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul( |
| texture_size_.width(), texture_size_.height()); |
| DrawAndLayout(surface->getCanvas(), texture_size_); |
| @@ -280,4 +287,10 @@ TEST(UrlBarTexture, LongPathsDoNotRequireElisionAndAreSupported) { |
| EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode()); |
| } |
| +TEST(UrlBarTexture, EmptyURL) { |
| + TestUrlBarTexture texture; |
| + texture.DrawURL(GURL()); |
| + EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode()); |
| +} |
| + |
| } // namespace vr_shell |