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

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

Issue 258513002: Introduce WorkerStoragePartitionId and use it in SharedWorkerInstance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hold WorkerStoragePartition in SharedWorkerMessageFilter Created 6 years, 8 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 632d9e74dcf4dd282735125af5266dd89e5f6d1c..83e51c171b358e8c671dd652b9e6999407a0a5fe 100644
--- a/content/browser/shared_worker/shared_worker_instance_unittest.cc
+++ b/content/browser/shared_worker/shared_worker_instance_unittest.cc
@@ -17,22 +17,29 @@ class SharedWorkerInstanceTest : public testing::Test {
protected:
SharedWorkerInstanceTest()
: browser_context_(new TestBrowserContext()),
- partition_(new WorkerStoragePartition(
- browser_context_->GetRequestContext(),
- NULL, NULL, NULL, NULL, NULL, NULL, NULL)) {
- }
+ partition_(
+ new WorkerStoragePartition(browser_context_->GetRequestContext(),
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL)),
+ partition_id_(*partition_.get()) {}
bool Matches(const SharedWorkerInstance& instance,
const std::string& url,
const base::StringPiece& name) {
return instance.Matches(GURL(url),
base::ASCIIToUTF16(name),
- *partition_.get(),
+ partition_id_,
browser_context_->GetResourceContext());
}
scoped_ptr<TestBrowserContext> browser_context_;
scoped_ptr<WorkerStoragePartition> partition_;
+ const WorkerStoragePartitionId partition_id_;
DISALLOW_COPY_AND_ASSIGN(SharedWorkerInstanceTest);
};
@@ -43,7 +50,7 @@ TEST_F(SharedWorkerInstanceTest, MatchesTest) {
base::string16(),
blink::WebContentSecurityPolicyTypeReport,
browser_context_->GetResourceContext(),
- *partition_.get());
+ partition_id_);
EXPECT_TRUE(Matches(instance1, "http://example.com/w.js", ""));
EXPECT_FALSE(Matches(instance1, "http://example.com/w2.js", ""));
EXPECT_FALSE(Matches(instance1, "http://example.net/w.js", ""));
@@ -58,7 +65,7 @@ TEST_F(SharedWorkerInstanceTest, MatchesTest) {
base::string16(),
blink::WebContentSecurityPolicyTypeReport,
browser_context_->GetResourceContext(),
- *partition_.get());
+ partition_id_);
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", ""));
« no previous file with comments | « content/browser/shared_worker/shared_worker_instance.cc ('k') | content/browser/shared_worker/shared_worker_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698