summaryrefslogtreecommitdiffstats
path: root/content/browser/appcache
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 08:31:43 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 08:31:43 +0000
commitbf510ed89ae0469951d8a9d39ca40e6c171db663 (patch)
tree781235082dd354a4731d32ac9322aff8ff30c73f /content/browser/appcache
parent52d213e0e78f33a43364913c1328cac0bac42299 (diff)
downloadchromium_src-bf510ed89ae0469951d8a9d39ca40e6c171db663.zip
chromium_src-bf510ed89ae0469951d8a9d39ca40e6c171db663.tar.gz
chromium_src-bf510ed89ae0469951d8a9d39ca40e6c171db663.tar.bz2
Unwire the clear on exit preference from the storage systems.
The "session only" rules should cover the functionality now UI changes and migration code will follow BUG=129349 TEST=added unit tests for the chrome/browser/net/sqlite* classes Review URL: https://chromiumcodereview.appspot.com/10447117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/appcache')
-rw-r--r--content/browser/appcache/chrome_appcache_service_unittest.cc44
1 files changed, 2 insertions, 42 deletions
diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc
index bbf7d76..f9f50d1 100644
--- a/content/browser/appcache/chrome_appcache_service_unittest.cc
+++ b/content/browser/appcache/chrome_appcache_service_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -126,7 +126,6 @@ TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) {
InsertDataIntoAppCache(appcache_service);
// Test: delete the ChromeAppCacheService
- appcache_service->set_clear_local_state_on_exit(false);
appcache_service = NULL;
message_loop_.RunAllPending();
@@ -151,44 +150,6 @@ TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) {
message_loop_.RunAllPending();
}
-TEST_F(ChromeAppCacheServiceTest, RemoveOnDestruction) {
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- FilePath appcache_path = temp_dir_.path().Append(kTestingAppCacheDirname);
-
- // Create a ChromeAppCacheService and insert data into it
- scoped_refptr<ChromeAppCacheService> appcache_service =
- CreateAppCacheService(appcache_path, true);
- ASSERT_TRUE(file_util::PathExists(appcache_path));
- ASSERT_TRUE(file_util::PathExists(appcache_path.AppendASCII("Index")));
- InsertDataIntoAppCache(appcache_service);
-
- // Test: delete the ChromeAppCacheService
- appcache_service->set_clear_local_state_on_exit(true);
- appcache_service = NULL;
- message_loop_.RunAllPending();
-
- // Recreate the appcache (for reading the data back)
- appcache_service = CreateAppCacheService(appcache_path, false);
-
- // The directory is still there
- ASSERT_TRUE(file_util::PathExists(appcache_path));
-
- // The appcache data for the protected origin is there, and the data for the
- // unprotected origin was deleted.
- AppCacheTestHelper appcache_helper;
- std::set<GURL> origins;
- appcache_helper.GetOriginsWithCaches(appcache_service, &origins);
- EXPECT_EQ(1UL, origins.size());
- EXPECT_TRUE(origins.find(kProtectedManifestURL.GetOrigin()) != origins.end());
- EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) == origins.end());
- EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) ==
- origins.end());
-
- // Delete and let cleanup tasks run prior to returning.
- appcache_service = NULL;
- message_loop_.RunAllPending();
-}
-
TEST_F(ChromeAppCacheServiceTest, SaveSessionState) {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
FilePath appcache_path = temp_dir_.path().Append(kTestingAppCacheDirname);
@@ -200,9 +161,8 @@ TEST_F(ChromeAppCacheServiceTest, SaveSessionState) {
ASSERT_TRUE(file_util::PathExists(appcache_path.AppendASCII("Index")));
InsertDataIntoAppCache(appcache_service);
- appcache_service->set_clear_local_state_on_exit(true);
// Save session state. This should bypass the destruction-time deletion.
- appcache_service->set_save_session_state(true);
+ appcache_service->set_force_keep_session_state();
// Test: delete the ChromeAppCacheService
appcache_service = NULL;