| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 "", | 251 "", |
| 252 "", | 252 "", |
| 253 "" | 253 "" |
| 254 }, { | 254 }, { |
| 255 "mailto:abc@example.com", | 255 "mailto:abc@example.com", |
| 256 "", | 256 "", |
| 257 "", | 257 "", |
| 258 "" | 258 "" |
| 259 }, | 259 }, |
| 260 }; | 260 }; |
| 261 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 261 for (size_t i = 0; i < arraysize(tests); ++i) { |
| 262 SCOPED_TRACE(base::StringPrintf("Test: %s", tests[i].input_url)); | 262 SCOPED_TRACE(base::StringPrintf("Test: %s", tests[i].input_url)); |
| 263 GURL url(tests[i].input_url); | 263 GURL url(tests[i].input_url); |
| 264 | 264 |
| 265 std::string canonicalized_hostname; | 265 std::string canonicalized_hostname; |
| 266 std::string canonicalized_path; | 266 std::string canonicalized_path; |
| 267 std::string canonicalized_query; | 267 std::string canonicalized_query; |
| 268 safe_browsing_util::CanonicalizeUrl(url, &canonicalized_hostname, | 268 safe_browsing_util::CanonicalizeUrl(url, &canonicalized_hostname, |
| 269 &canonicalized_path, &canonicalized_query); | 269 &canonicalized_path, &canonicalized_query); |
| 270 | 270 |
| 271 EXPECT_EQ(tests[i].expected_canonicalized_hostname, | 271 EXPECT_EQ(tests[i].expected_canonicalized_hostname, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 EXPECT_FALSE(SBFullHashEqual(kHash2, kHash1)); | 330 EXPECT_FALSE(SBFullHashEqual(kHash2, kHash1)); |
| 331 | 331 |
| 332 EXPECT_FALSE(SBFullHashLess(kHash1, kHash2)); | 332 EXPECT_FALSE(SBFullHashLess(kHash1, kHash2)); |
| 333 EXPECT_TRUE(SBFullHashLess(kHash2, kHash1)); | 333 EXPECT_TRUE(SBFullHashLess(kHash2, kHash1)); |
| 334 | 334 |
| 335 EXPECT_FALSE(SBFullHashLess(kHash1, kHash1)); | 335 EXPECT_FALSE(SBFullHashLess(kHash1, kHash1)); |
| 336 EXPECT_FALSE(SBFullHashLess(kHash2, kHash2)); | 336 EXPECT_FALSE(SBFullHashLess(kHash2, kHash2)); |
| 337 } | 337 } |
| 338 | 338 |
| 339 } // namespace | 339 } // namespace |
| OLD | NEW |