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

Unified Diff: third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp

Issue 1985703003: Add isUnique check to isSameSchemeHostPort. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: separate out == check, and add some tests Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
index 483f19a2e671c4cf76a0268ecdb0364b3e418c6a..b2f04e14e087b8d53ed41ccd138c5e2b8b75e2e5 100644
--- a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
@@ -81,7 +81,7 @@ TEST_F(SecurityOriginTest, LocalAccess)
// Block |file1|'s access to local origins. It should now be same-origin
// with itself, but shouldn't have access to |file2|.
file1->blockLocalAccessFromLocalOrigin();
- EXPECT_FALSE(file1->isSameSchemeHostPort(file1.get()));
+ EXPECT_TRUE(file1->isSameSchemeHostPort(file1.get()));
EXPECT_FALSE(file1->isSameSchemeHostPort(file2.get()));
EXPECT_FALSE(file2->isSameSchemeHostPort(file1.get()));
@@ -435,4 +435,15 @@ TEST_F(SecurityOriginTest, UniquenessPropagatesToBlobUrls)
}
}
+TEST_F(SecurityOriginTest, UniqueOriginIsSameSchemeHostPort)
+{
+ RefPtr<SecurityOrigin> uniqueOrigin = SecurityOrigin::createUnique();
+ RefPtr<SecurityOrigin> tupleOrigin = SecurityOrigin::createFromString("http://example.com");
+
+ EXPECT_TRUE(uniqueOrigin->isSameSchemeHostPort(uniqueOrigin.get()));
Mike West 2016/06/03 05:22:04 Why is this true? I'd expect it to be false (becau
Marijn Kruisselbrink 2016/06/03 05:25:11 According to the HTML specification of origins an
+ EXPECT_FALSE(SecurityOrigin::createUnique()->isSameSchemeHostPort(uniqueOrigin.get()));
+ EXPECT_FALSE(tupleOrigin->isSameSchemeHostPort(uniqueOrigin.get()));
+ EXPECT_FALSE(uniqueOrigin->isSameSchemeHostPort(tupleOrigin.get()));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698