| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h" | 5 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 EXPECT_CALL(mock_, SetColor(kIncognitoDeemphasizedColor)); | 163 EXPECT_CALL(mock_, SetColor(kIncognitoDeemphasizedColor)); |
| 164 EXPECT_CALL(mock_, ApplyColor(kIncognitoEmphasizedColor, gfx::Range(0, 8))); | 164 EXPECT_CALL(mock_, ApplyColor(kIncognitoEmphasizedColor, gfx::Range(0, 8))); |
| 165 Verify("http://host.com/page", SecurityLevel::HTTP_SHOW_WARNING, | 165 Verify("http://host.com/page", SecurityLevel::HTTP_SHOW_WARNING, |
| 166 "host.com/page"); | 166 "host.com/page"); |
| 167 } | 167 } |
| 168 | 168 |
| 169 TEST_F(UrlEmphasisTest, DangerousHttpsHost) { | 169 TEST_F(UrlEmphasisTest, DangerousHttpsHost) { |
| 170 EXPECT_CALL(mock_, SetColor(kDeemphasizedColor)); | 170 EXPECT_CALL(mock_, SetColor(kDeemphasizedColor)); |
| 171 EXPECT_CALL(mock_, ApplyColor(kEmphasizedColor, gfx::Range(8, 16))); | 171 EXPECT_CALL(mock_, ApplyColor(kEmphasizedColor, gfx::Range(8, 16))); |
| 172 EXPECT_CALL(mock_, ApplyColor(kWarningColor, gfx::Range(0, 5))); | 172 EXPECT_CALL(mock_, ApplyColor(kWarningColor, gfx::Range(0, 5))); |
| 173 EXPECT_CALL(mock_, ApplyStyle(gfx::TextStyle::DIAGONAL_STRIKE, true, | 173 EXPECT_CALL(mock_, |
| 174 gfx::Range(0, 5))); | 174 ApplyStyle(gfx::TextStyle::STRIKE, true, gfx::Range(0, 5))); |
| 175 EXPECT_CALL(mock_, SetColor(kIncognitoDeemphasizedColor)); | 175 EXPECT_CALL(mock_, SetColor(kIncognitoDeemphasizedColor)); |
| 176 EXPECT_CALL(mock_, ApplyColor(kIncognitoEmphasizedColor, gfx::Range(8, 16))); | 176 EXPECT_CALL(mock_, ApplyColor(kIncognitoEmphasizedColor, gfx::Range(8, 16))); |
| 177 EXPECT_CALL(mock_, ApplyColor(kIncognitoWarningColor, gfx::Range(0, 5))); | 177 EXPECT_CALL(mock_, ApplyColor(kIncognitoWarningColor, gfx::Range(0, 5))); |
| 178 EXPECT_CALL(mock_, ApplyStyle(gfx::TextStyle::DIAGONAL_STRIKE, true, | 178 EXPECT_CALL(mock_, |
| 179 gfx::Range(0, 5))); | 179 ApplyStyle(gfx::TextStyle::STRIKE, true, gfx::Range(0, 5))); |
| 180 Verify("https://host.com/page", SecurityLevel::DANGEROUS, | 180 Verify("https://host.com/page", SecurityLevel::DANGEROUS, |
| 181 "https://host.com/page"); | 181 "https://host.com/page"); |
| 182 } | 182 } |
| 183 | 183 |
| 184 TEST_F(UrlEmphasisTest, Data) { | 184 TEST_F(UrlEmphasisTest, Data) { |
| 185 EXPECT_CALL(mock_, SetColor(kDeemphasizedColor)); | 185 EXPECT_CALL(mock_, SetColor(kDeemphasizedColor)); |
| 186 EXPECT_CALL(mock_, ApplyColor(kEmphasizedColor, gfx::Range(0, 4))); | 186 EXPECT_CALL(mock_, ApplyColor(kEmphasizedColor, gfx::Range(0, 4))); |
| 187 EXPECT_CALL(mock_, SetColor(kIncognitoDeemphasizedColor)); | 187 EXPECT_CALL(mock_, SetColor(kIncognitoDeemphasizedColor)); |
| 188 EXPECT_CALL(mock_, ApplyColor(kIncognitoEmphasizedColor, gfx::Range(0, 4))); | 188 EXPECT_CALL(mock_, ApplyColor(kIncognitoEmphasizedColor, gfx::Range(0, 4))); |
| 189 Verify("data:text/html,lots of data", SecurityLevel::NONE, | 189 Verify("data:text/html,lots of data", SecurityLevel::NONE, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 TestUrlBarTexture texture; | 229 TestUrlBarTexture texture; |
| 230 texture.DrawURL(GURL( | 230 texture.DrawURL(GURL( |
| 231 "https://something.com/" | 231 "https://something.com/" |
| 232 "thereisnopossiblewaythatthishostnamecouldbecontainedinthelimitedspacetha" | 232 "thereisnopossiblewaythatthishostnamecouldbecontainedinthelimitedspacetha" |
| 233 "tweareaffordedtousitsreallynotsomethingweshouldconsiderorplanfororpinour" | 233 "tweareaffordedtousitsreallynotsomethingweshouldconsiderorplanfororpinour" |
| 234 "hopesonlestwegetdisappointedorsad.com")); | 234 "hopesonlestwegetdisappointedorsad.com")); |
| 235 EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode()); | 235 EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode()); |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace vr_shell | 238 } // namespace vr_shell |
| OLD | NEW |