OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/file_version_info.h" | 5 #include "base/file_version_info.h" |
6 #include "base/file_version_info_win.h" | 6 #include "base/file_version_info_win.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 class MockNavigationConstraints : public NavigationConstraints { | 232 class MockNavigationConstraints : public NavigationConstraints { |
233 public: | 233 public: |
234 MOCK_METHOD0(AllowUnsafeUrls, bool()); | 234 MOCK_METHOD0(AllowUnsafeUrls, bool()); |
235 MOCK_METHOD1(IsSchemeAllowed, bool(const GURL& url)); | 235 MOCK_METHOD1(IsSchemeAllowed, bool(const GURL& url)); |
236 MOCK_METHOD1(IsZoneAllowed, bool(const GURL& url)); | 236 MOCK_METHOD1(IsZoneAllowed, bool(const GURL& url)); |
237 }; | 237 }; |
238 | 238 |
239 // Matcher which returns true if the URL passed in starts with the prefix | 239 // Matcher which returns true if the URL passed in starts with the prefix |
240 // specified. | 240 // specified. |
241 MATCHER_P(UrlPathStartsWith, url_prefix, "url starts with prefix") { | 241 MATCHER_P(UrlPathStartsWith, url_prefix, "url starts with prefix") { |
242 return StartsWith(UTF8ToWide(arg.spec()), url_prefix, false); | 242 return StartsWith(base::UTF8ToWide(arg.spec()), url_prefix, false); |
243 } | 243 } |
244 | 244 |
245 ACTION_P3(HandleZone, mock, url_prefix, zone) { | 245 ACTION_P3(HandleZone, mock, url_prefix, zone) { |
246 if (StartsWith(UTF8ToWide(arg0.spec()), url_prefix, false)) | 246 if (StartsWith(base::UTF8ToWide(arg0.spec()), url_prefix, false)) |
247 return zone != URLZONE_UNTRUSTED; | 247 return zone != URLZONE_UNTRUSTED; |
248 return false; | 248 return false; |
249 } | 249 } |
250 | 250 |
251 TEST_F(UtilTests, CanNavigateTest) { | 251 TEST_F(UtilTests, CanNavigateTest) { |
252 MockNavigationConstraintsZoneOverride mock; | 252 MockNavigationConstraintsZoneOverride mock; |
253 | 253 |
254 struct Zones { | 254 struct Zones { |
255 const wchar_t* url_prefix; | 255 const wchar_t* url_prefix; |
256 URLZONE zone; | 256 URLZONE zone; |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 542 |
543 ASSERT_EQ(expect_match, | 543 ASSERT_EQ(expect_match, |
544 CheckXUaCompatibleDirective(test.header_value, | 544 CheckXUaCompatibleDirective(test.header_value, |
545 all_versions[version_index])) | 545 all_versions[version_index])) |
546 << "Expect '" << test.header_value << "' to " | 546 << "Expect '" << test.header_value << "' to " |
547 << (expect_match ? "match" : "not match") << " IE major version " | 547 << (expect_match ? "match" : "not match") << " IE major version " |
548 << all_versions[version_index]; | 548 << all_versions[version_index]; |
549 } | 549 } |
550 } | 550 } |
551 } | 551 } |
OLD | NEW |