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

Unified Diff: chrome/browser/appcache/chrome_appcache_service_unittest.cc

Issue 6586001: Move appcache/file_sytem/device_orientation subdirectories of chrome\browser ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 9 years, 10 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: chrome/browser/appcache/chrome_appcache_service_unittest.cc
===================================================================
--- chrome/browser/appcache/chrome_appcache_service_unittest.cc (revision 75978)
+++ chrome/browser/appcache/chrome_appcache_service_unittest.cc (working copy)
@@ -1,101 +0,0 @@
-// Copyright (c) 2011 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.
-
-#include "base/file_util.h"
-#include "base/message_loop.h"
-#include "base/ref_counted.h"
-#include "base/scoped_temp_dir.h"
-#include "chrome/browser/appcache/chrome_appcache_service.h"
-#include "chrome/browser/browser_thread.h"
-#include "chrome/common/chrome_constants.h"
-#include "chrome/test/testing_browser_process.h"
-#include "chrome/test/testing_browser_process_test.h"
-#include "chrome/test/thread_test_helper.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/appcache/appcache_storage_impl.h"
-
-namespace appcache {
-
-class ChromeAppCacheServiceTest : public TestingBrowserProcessTest {
- public:
- ChromeAppCacheServiceTest()
- : message_loop_(MessageLoop::TYPE_IO),
- db_thread_(BrowserThread::DB, &message_loop_),
- file_thread_(BrowserThread::FILE, &message_loop_),
- cache_thread_(BrowserThread::CACHE, &message_loop_),
- io_thread_(BrowserThread::IO, &message_loop_) {
- }
-
- protected:
- MessageLoop message_loop_;
- ScopedTempDir temp_dir_;
-
- private:
- BrowserThread db_thread_;
- BrowserThread file_thread_;
- BrowserThread cache_thread_;
- BrowserThread io_thread_;
-};
-
-TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) {
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- FilePath appcache_path = temp_dir_.path().Append(chrome::kAppCacheDirname);
- scoped_refptr<ChromeAppCacheService> appcache_service =
- new ChromeAppCacheService;
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(appcache_service.get(),
- &ChromeAppCacheService::InitializeOnIOThread,
- temp_dir_.path(), false,
- scoped_refptr<HostContentSettingsMap>(NULL),
- false));
- // Make the steps needed to initialize the storage of AppCache data.
- message_loop_.RunAllPending();
- appcache::AppCacheStorageImpl* storage =
- static_cast<appcache::AppCacheStorageImpl*>(appcache_service->storage());
- ASSERT_TRUE(storage->database_->db_connection());
- ASSERT_EQ(1, storage->NewCacheId());
- storage->disk_cache();
- message_loop_.RunAllPending();
-
- ASSERT_TRUE(file_util::PathExists(appcache_path));
- ASSERT_TRUE(file_util::PathExists(appcache_path.AppendASCII("Index")));
-
- appcache_service = NULL;
- message_loop_.RunAllPending();
-
- ASSERT_TRUE(file_util::PathExists(appcache_path));
-}
-
-TEST_F(ChromeAppCacheServiceTest, RemoveOnDestruction) {
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- FilePath appcache_path = temp_dir_.path().Append(chrome::kAppCacheDirname);
- scoped_refptr<ChromeAppCacheService> appcache_service =
- new ChromeAppCacheService;
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(appcache_service.get(),
- &ChromeAppCacheService::InitializeOnIOThread,
- temp_dir_.path(), false,
- scoped_refptr<HostContentSettingsMap>(NULL),
- true));
- // Make the steps needed to initialize the storage of AppCache data.
- message_loop_.RunAllPending();
- appcache::AppCacheStorageImpl* storage =
- static_cast<appcache::AppCacheStorageImpl*>(appcache_service->storage());
- ASSERT_TRUE(storage->database_->db_connection());
- ASSERT_EQ(1, storage->NewCacheId());
- storage->disk_cache();
- message_loop_.RunAllPending();
-
- ASSERT_TRUE(file_util::PathExists(appcache_path));
- ASSERT_TRUE(file_util::PathExists(appcache_path.AppendASCII("Index")));
-
- appcache_service = NULL;
- message_loop_.RunAllPending();
-
- ASSERT_FALSE(file_util::PathExists(appcache_path));
-}
-
-} // namespace appcache
« no previous file with comments | « chrome/browser/appcache/chrome_appcache_service.cc ('k') | chrome/browser/appcache/view_appcache_internals_job_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698