OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ios/web/public/referrer_util.h" | 5 #include "ios/web/public/referrer_util.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "ios/web/public/referrer.h" | 8 #include "ios/web/public/referrer.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/gurl.h" | 10 #include "url/gurl.h" |
10 | 11 |
11 namespace { | 12 namespace { |
12 | 13 |
13 const char* const kTestUrls[] = { | 14 const char* const kTestUrls[] = { |
14 "", | 15 "", |
15 "http://user:password@foo.com/a/b/c.html", | 16 "http://user:password@foo.com/a/b/c.html", |
16 "https://foo.com/d.html#fragment", | 17 "https://foo.com/d.html#fragment", |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 EXPECT_EQ(ReferrerPolicyNoReferrerWhenDowngrade, | 200 EXPECT_EQ(ReferrerPolicyNoReferrerWhenDowngrade, |
200 ReferrerPolicyFromString("default")); | 201 ReferrerPolicyFromString("default")); |
201 EXPECT_EQ(ReferrerPolicyAlways, ReferrerPolicyFromString("always")); | 202 EXPECT_EQ(ReferrerPolicyAlways, ReferrerPolicyFromString("always")); |
202 | 203 |
203 // Test that invalid values map to Never. | 204 // Test that invalid values map to Never. |
204 EXPECT_EQ(ReferrerPolicyNever, ReferrerPolicyFromString("")); | 205 EXPECT_EQ(ReferrerPolicyNever, ReferrerPolicyFromString("")); |
205 EXPECT_EQ(ReferrerPolicyNever, ReferrerPolicyFromString("made-up")); | 206 EXPECT_EQ(ReferrerPolicyNever, ReferrerPolicyFromString("made-up")); |
206 } | 207 } |
207 | 208 |
208 } // namespace web | 209 } // namespace web |
OLD | NEW |