| Index: third_party/WebKit/Source/core/dom/DocumentTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/DocumentTest.cpp b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
|
| index f4cab42eaa3f5c5c49a0739ce219a5add123a87a..b7f3156c6fb14154f21656d32cebca411fa21ef5 100644
|
| --- a/third_party/WebKit/Source/core/dom/DocumentTest.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
|
| @@ -185,12 +185,18 @@ TEST_F(DocumentTest, referrerPolicyParsing)
|
| const char* policy;
|
| ReferrerPolicy expected;
|
| } tests[] = {
|
| + { "", ReferrerPolicyDefault },
|
| + // Test that invalid policy values are ignored.
|
| + { "not-a-real-policy", ReferrerPolicyDefault },
|
| + { "not-a-real-policy,also-not-a-real-policy", ReferrerPolicyDefault },
|
| + { "not-a-real-policy,unsafe-url", ReferrerPolicyAlways },
|
| + { "unsafe-url,not-a-real-policy", ReferrerPolicyAlways },
|
| + // Test parsing each of the policy values.
|
| { "always", ReferrerPolicyAlways },
|
| { "default", ReferrerPolicyNoReferrerWhenDowngrade },
|
| { "never", ReferrerPolicyNever },
|
| { "no-referrer", ReferrerPolicyNever },
|
| { "no-referrer-when-downgrade", ReferrerPolicyNoReferrerWhenDowngrade },
|
| - { "not-a-real-policy", ReferrerPolicyDefault },
|
| { "origin", ReferrerPolicyOrigin },
|
| { "origin-when-crossorigin", ReferrerPolicyOriginWhenCrossOrigin },
|
| { "origin-when-cross-origin", ReferrerPolicyOriginWhenCrossOrigin },
|
| @@ -199,8 +205,7 @@ TEST_F(DocumentTest, referrerPolicyParsing)
|
|
|
| for (auto test : tests) {
|
| document().setReferrerPolicy(ReferrerPolicyDefault);
|
| -
|
| - document().processReferrerPolicy(test.policy);
|
| + document().parseAndSetReferrerPolicy(test.policy);
|
| EXPECT_EQ(test.expected, document().getReferrerPolicy()) << test.policy;
|
| }
|
| }
|
|
|