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

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

Issue 2960903002: VR: Use ToolbarModel to drive VR URL bar state. (Closed)
Patch Set: Update toolbar build file to include vector icons for Android. 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 01709d451131a62997ee065d9278c5c9e96312b9..452a5920256c97c84b9d29ba5ad56ac1ed6ba8a1 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,11 @@ class TestUrlBarTexture : public UrlBarTexture {
void DrawURL(const GURL& gurl) {
unsupported_mode_ = UiUnsupportedMode::kCount;
- SetURL(gurl);
+ ToolbarState state(gurl, SecurityLevel::HTTP_SHOW_WARNING,
+ &toolbar::kHttpsInvalidIcon,
+ base::UTF8ToUTF16("Not secure"), true);
+ 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 +286,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
« no previous file with comments | « chrome/browser/android/vr_shell/textures/url_bar_texture.cc ('k') | chrome/browser/android/vr_shell/toolbar_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698