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

Unified Diff: content/browser/in_process_webkit/webkit_context_unittest.cc

Issue 7480041: Adding session-only localStorage. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Adding tests. Created 9 years, 5 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/in_process_webkit/webkit_context_unittest.cc
diff --git a/content/browser/in_process_webkit/webkit_context_unittest.cc b/content/browser/in_process_webkit/webkit_context_unittest.cc
index b11216dc70729ad511faefa7ce52a9f0fff4a9e3..47015be641d6151cddef61225fdb7717c84091f5 100644
--- a/content/browser/in_process_webkit/webkit_context_unittest.cc
+++ b/content/browser/in_process_webkit/webkit_context_unittest.cc
@@ -11,8 +11,11 @@
class MockDOMStorageContext : public DOMStorageContext {
public:
MockDOMStorageContext(WebKitContext* webkit_context,
- quota::SpecialStoragePolicy* special_storage_policy)
- : DOMStorageContext(webkit_context, special_storage_policy),
+ quota::SpecialStoragePolicy* special_storage_policy,
+ const content::ResourceContext& resource_context)
+ : DOMStorageContext(webkit_context,
+ special_storage_policy,
+ resource_context),
purge_count_(0) {
}
@@ -33,6 +36,7 @@ TEST(WebKitContextTest, Basic) {
scoped_refptr<WebKitContext> context1(new WebKitContext(
profile.IsOffTheRecord(), profile.GetPath(),
profile.GetSpecialStoragePolicy(),
+ profile.GetResourceContext(),
false, NULL, NULL));
EXPECT_TRUE(profile.GetPath() == context1->data_path());
EXPECT_TRUE(profile.IsOffTheRecord() == context1->is_incognito());
@@ -40,6 +44,7 @@ TEST(WebKitContextTest, Basic) {
scoped_refptr<WebKitContext> context2(new WebKitContext(
profile.IsOffTheRecord(), profile.GetPath(),
profile.GetSpecialStoragePolicy(),
+ profile.GetResourceContext(),
false, NULL, NULL));
EXPECT_TRUE(context1->data_path() == context2->data_path());
EXPECT_TRUE(context1->is_incognito() == context2->is_incognito());
@@ -57,9 +62,12 @@ TEST(WebKitContextTest, PurgeMemory) {
scoped_refptr<WebKitContext> context(new WebKitContext(
profile.IsOffTheRecord(), profile.GetPath(),
profile.GetSpecialStoragePolicy(),
+ profile.GetResourceContext(),
false, NULL, NULL));
MockDOMStorageContext* mock_context = new MockDOMStorageContext(
- context.get(), profile.GetSpecialStoragePolicy());
+ context.get(),
+ profile.GetSpecialStoragePolicy(),
+ profile.GetResourceContext());
context->set_dom_storage_context(mock_context); // Takes ownership.
// Ensure PurgeMemory() calls our mock object on the right thread.

Powered by Google App Engine
This is Rietveld 408576698