Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentTest.cpp

Issue 2918313002: Implement new referrer policies (Closed)
Patch Set: update public/platform/OWNERS per presubmit Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 {"always", kReferrerPolicyAlways, true}, 459 {"always", kReferrerPolicyAlways, true},
460 {"default", kReferrerPolicyNoReferrerWhenDowngrade, true}, 460 {"default", kReferrerPolicyNoReferrerWhenDowngrade, true},
461 {"never", kReferrerPolicyNever, true}, 461 {"never", kReferrerPolicyNever, true},
462 {"no-referrer", kReferrerPolicyNever, false}, 462 {"no-referrer", kReferrerPolicyNever, false},
463 {"default", kReferrerPolicyNoReferrerWhenDowngrade, true}, 463 {"default", kReferrerPolicyNoReferrerWhenDowngrade, true},
464 {"no-referrer-when-downgrade", kReferrerPolicyNoReferrerWhenDowngrade, 464 {"no-referrer-when-downgrade", kReferrerPolicyNoReferrerWhenDowngrade,
465 false}, 465 false},
466 {"origin", kReferrerPolicyOrigin, false}, 466 {"origin", kReferrerPolicyOrigin, false},
467 {"origin-when-crossorigin", kReferrerPolicyOriginWhenCrossOrigin, true}, 467 {"origin-when-crossorigin", kReferrerPolicyOriginWhenCrossOrigin, true},
468 {"origin-when-cross-origin", kReferrerPolicyOriginWhenCrossOrigin, false}, 468 {"origin-when-cross-origin", kReferrerPolicyOriginWhenCrossOrigin, false},
469 {"same-origin", kReferrerPolicySameOrigin, false},
470 {"strict-origin", kReferrerPolicyStrictOrigin, false},
471 {"strict-origin-when-cross-origin",
472 kReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin, false},
469 {"unsafe-url", kReferrerPolicyAlways}, 473 {"unsafe-url", kReferrerPolicyAlways},
470 }; 474 };
471 475
472 for (auto test : tests) { 476 for (auto test : tests) {
473 GetDocument().SetReferrerPolicy(kReferrerPolicyDefault); 477 GetDocument().SetReferrerPolicy(kReferrerPolicyDefault);
474 if (test.is_legacy) { 478 if (test.is_legacy) {
475 // Legacy keyword support must be explicitly enabled for the policy to 479 // Legacy keyword support must be explicitly enabled for the policy to
476 // parse successfully. 480 // parse successfully.
477 GetDocument().ParseAndSetReferrerPolicy(test.policy); 481 GetDocument().ParseAndSetReferrerPolicy(test.policy);
478 EXPECT_EQ(kReferrerPolicyDefault, GetDocument().GetReferrerPolicy()); 482 EXPECT_EQ(kReferrerPolicyDefault, GetDocument().GetReferrerPolicy());
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending, 866 EXPECT_EQ(DocumentLifecycle::kVisualUpdatePending,
863 GetDocument().Lifecycle().GetState()); 867 GetDocument().Lifecycle().GetState());
864 868
865 GetDocument().EnsurePaintLocationDataValidForNode( 869 GetDocument().EnsurePaintLocationDataValidForNode(
866 GetDocument().getElementById("stickyChild")); 870 GetDocument().getElementById("stickyChild"));
867 EXPECT_EQ(DocumentLifecycle::kCompositingInputsClean, 871 EXPECT_EQ(DocumentLifecycle::kCompositingInputsClean,
868 GetDocument().Lifecycle().GetState()); 872 GetDocument().Lifecycle().GetState());
869 } 873 }
870 874
871 } // namespace blink 875 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698