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

Side by Side Diff: third_party/WebKit/Source/core/frame/csp/CSPSourceTest.cpp

Issue 2556713002: Embedding-CSP: Ports subsumption (Closed)
Patch Set: Adding a comment Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/csp/CSPSource.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/frame/csp/CSPSource.h" 5 #include "core/frame/csp/CSPSource.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/csp/ContentSecurityPolicy.h" 8 #include "core/frame/csp/ContentSecurityPolicy.h"
9 #include "platform/network/ResourceRequest.h" 9 #include "platform/network/ResourceRequest.h"
10 #include "platform/weborigin/KURL.h" 10 #include "platform/weborigin/KURL.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 {{"https", "example.com", "/", 0}, {"http", "example.com", "/", 0}, true}, 381 {{"https", "example.com", "/", 0}, {"http", "example.com", "/", 0}, true},
382 {{"ws", "example.com", "/", 0}, {"wss", "example.com", "/", 0}, true}, 382 {{"ws", "example.com", "/", 0}, {"wss", "example.com", "/", 0}, true},
383 // Ports 383 // Ports
384 {{"http", "example.com", "/", 90}, 384 {{"http", "example.com", "/", 90},
385 {"http", "example.com", "/", 90}, 385 {"http", "example.com", "/", 90},
386 true}, 386 true},
387 {{"wss", "example.com", "/", 0}, 387 {{"wss", "example.com", "/", 0},
388 {"wss", "example.com", "/", 0}, 388 {"wss", "example.com", "/", 0},
389 true}, // use default port 389 true}, // use default port
390 {{"http", "example.com", "/", 80}, {"http", "example.com", "/", 0}, true}, 390 {{"http", "example.com", "/", 80}, {"http", "example.com", "/", 0}, true},
391 {{"http", "example.com", "/", 80},
392 {"https", "example.com", "/", 443},
393 true},
394 {{"http", "example.com", "/", 80},
395 {"https", "example.com", "/", 444},
396 false},
391 // Paths 397 // Paths
392 {{"http", "example.com", "/", 0}, 398 {{"http", "example.com", "/", 0},
393 {"http", "example.com", "/1.html", 0}, 399 {"http", "example.com", "/1.html", 0},
394 true}, 400 true},
395 {{"http", "example.com", "/", 0}, {"http", "example.com", "", 0}, true}, 401 {{"http", "example.com", "/", 0}, {"http", "example.com", "", 0}, true},
396 {{"http", "example.com", "/", 0}, 402 {{"http", "example.com", "/", 0},
397 {"http", "example.com", "/a/b/", 0}, 403 {"http", "example.com", "/a/b/", 0},
398 true}, 404 true},
399 {{"http", "example.com", "/a/", 0}, 405 {{"http", "example.com", "/a/", 0},
400 {"http", "example.com", "/a/", 0}, 406 {"http", "example.com", "/a/", 0},
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 CSPSource::HasWildcard}, 599 CSPSource::HasWildcard},
594 {"http", "example.com", "/", 0, CSPSource::NoWildcard, 600 {"http", "example.com", "/", 0, CSPSource::NoWildcard,
595 CSPSource::NoWildcard}}, 601 CSPSource::NoWildcard}},
596 // Ports 602 // Ports
597 {{"http", "example.com", "/", 80, CSPSource::NoWildcard, 603 {{"http", "example.com", "/", 80, CSPSource::NoWildcard,
598 CSPSource::NoWildcard}, 604 CSPSource::NoWildcard},
599 {"http", "example.com", "/", 0, CSPSource::NoWildcard, 605 {"http", "example.com", "/", 0, CSPSource::NoWildcard,
600 CSPSource::NoWildcard}, 606 CSPSource::NoWildcard},
601 {"http", "example.com", "/", 80, CSPSource::NoWildcard, 607 {"http", "example.com", "/", 80, CSPSource::NoWildcard,
602 CSPSource::NoWildcard}}, 608 CSPSource::NoWildcard}},
609 {{"http", "example.com", "/", 80, CSPSource::NoWildcard,
610 CSPSource::NoWildcard},
611 {"https", "example.com", "/", 443, CSPSource::NoWildcard,
612 CSPSource::NoWildcard},
613 {"https", "example.com", "/", 443, CSPSource::NoWildcard,
614 CSPSource::NoWildcard}},
615 {{"https", "example.com", "/", 443, CSPSource::NoWildcard,
616 CSPSource::NoWildcard},
617 {"http", "example.com", "/", 80, CSPSource::NoWildcard,
618 CSPSource::NoWildcard},
619 {"https", "example.com", "/", 443, CSPSource::NoWildcard,
620 CSPSource::NoWildcard}},
603 // Paths 621 // Paths
604 {{"http", "example.com", "/", 0, CSPSource::NoWildcard, 622 {{"http", "example.com", "/", 0, CSPSource::NoWildcard,
605 CSPSource::NoWildcard}, 623 CSPSource::NoWildcard},
606 {"http", "example.com", "/1.html", 0, CSPSource::NoWildcard, 624 {"http", "example.com", "/1.html", 0, CSPSource::NoWildcard,
607 CSPSource::NoWildcard}, 625 CSPSource::NoWildcard},
608 {"http", "example.com", "/1.html", 0, CSPSource::NoWildcard, 626 {"http", "example.com", "/1.html", 0, CSPSource::NoWildcard,
609 CSPSource::NoWildcard}}, 627 CSPSource::NoWildcard}},
610 {{"http", "example.com", "/", 0, CSPSource::NoWildcard, 628 {{"http", "example.com", "/", 0, CSPSource::NoWildcard,
611 CSPSource::NoWildcard}, 629 CSPSource::NoWildcard},
612 {"http", "example.com", "", 0, CSPSource::NoWildcard, 630 {"http", "example.com", "", 0, CSPSource::NoWildcard,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 normalized = B->intersect(A); 755 normalized = B->intersect(A);
738 Source intersectBA = { 756 Source intersectBA = {
739 normalized->m_scheme, normalized->m_host, 757 normalized->m_scheme, normalized->m_host,
740 normalized->m_path, normalized->m_port, 758 normalized->m_path, normalized->m_port,
741 normalized->m_hostWildcard, normalized->m_portWildcard}; 759 normalized->m_hostWildcard, normalized->m_portWildcard};
742 EXPECT_TRUE(equalSources(intersectBA, test.normalized)); 760 EXPECT_TRUE(equalSources(intersectBA, test.normalized));
743 } 761 }
744 } 762 }
745 763
746 } // namespace blink 764 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/csp/CSPSource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698