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

Unified Diff: content/browser/shared_worker/shared_worker_instance_unittest.cc

Issue 1775933002: CORS-RFC1918: Pipe creator address space through SharedWorker creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 9 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
Index: content/browser/shared_worker/shared_worker_instance_unittest.cc
diff --git a/content/browser/shared_worker/shared_worker_instance_unittest.cc b/content/browser/shared_worker/shared_worker_instance_unittest.cc
index c78cb1fe0a5f76ae36b33f437875f1f86e6f2ba0..9e773f71472dd00ed4e9217d566aa1f8c928eb5b 100644
--- a/content/browser/shared_worker/shared_worker_instance_unittest.cc
+++ b/content/browser/shared_worker/shared_worker_instance_unittest.cc
@@ -49,7 +49,7 @@ class SharedWorkerInstanceTest : public testing::Test {
TEST_F(SharedWorkerInstanceTest, MatchesTest) {
SharedWorkerInstance instance1(
GURL("http://example.com/w.js"), base::string16(), base::string16(),
- blink::WebContentSecurityPolicyTypeReport,
+ blink::WebContentSecurityPolicyTypeReport, blink::WebAddressSpacePublic,
browser_context_->GetResourceContext(), partition_id_,
blink::WebSharedWorkerCreationContextTypeNonsecure);
EXPECT_TRUE(Matches(instance1, "http://example.com/w.js", ""));
@@ -64,8 +64,8 @@ TEST_F(SharedWorkerInstanceTest, MatchesTest) {
SharedWorkerInstance instance2(
GURL("http://example.com/w.js"), base::ASCIIToUTF16("name"),
base::string16(), blink::WebContentSecurityPolicyTypeReport,
- browser_context_->GetResourceContext(), partition_id_,
- blink::WebSharedWorkerCreationContextTypeNonsecure);
+ blink::WebAddressSpacePublic, browser_context_->GetResourceContext(),
+ partition_id_, blink::WebSharedWorkerCreationContextTypeNonsecure);
EXPECT_FALSE(Matches(instance2, "http://example.com/w.js", ""));
EXPECT_FALSE(Matches(instance2, "http://example.com/w2.js", ""));
EXPECT_FALSE(Matches(instance2, "http://example.net/w.js", ""));
@@ -80,4 +80,17 @@ TEST_F(SharedWorkerInstanceTest, MatchesTest) {
EXPECT_FALSE(Matches(instance2, "http://example.net/w2.js", "name2"));
}
+TEST_F(SharedWorkerInstanceTest, AddressSpace) {
+ for (int i = 0; i < static_cast<int>(blink::WebAddressSpaceLast); i++) {
+ SharedWorkerInstance instance(
+ GURL("http://example.com/w.js"), base::ASCIIToUTF16("name"),
+ base::string16(), blink::WebContentSecurityPolicyTypeReport,
+ static_cast<blink::WebAddressSpace>(i),
+ browser_context_->GetResourceContext(), partition_id_,
+ blink::WebSharedWorkerCreationContextTypeNonsecure);
+ EXPECT_EQ(static_cast<blink::WebAddressSpace>(i),
+ instance.creation_address_space());
+ }
+}
+
} // namespace content
« no previous file with comments | « content/browser/shared_worker/shared_worker_instance.cc ('k') | content/browser/shared_worker/shared_worker_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698