Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "chrome/browser/appcache/chrome_appcache_service.h" | 9 #include "chrome/browser/appcache/chrome_appcache_service.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| 11 #include "chrome/common/chrome_constants.h" | 11 #include "chrome/common/chrome_constants.h" |
| 12 #include "chrome/test/testing_browser_process.h" | |
| 12 #include "chrome/test/thread_test_helper.h" | 13 #include "chrome/test/thread_test_helper.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "webkit/appcache/appcache_storage_impl.h" | 15 #include "webkit/appcache/appcache_storage_impl.h" |
| 15 | 16 |
| 16 namespace appcache { | 17 namespace appcache { |
| 17 | 18 |
| 18 class ChromeAppCacheServiceTest : public testing::Test { | 19 class ChromeAppCacheServiceTest : public testing::Test { |
|
sky
2011/02/14 17:01:19
TestingBrowserProcessTest?
| |
| 19 public: | 20 public: |
| 20 ChromeAppCacheServiceTest() | 21 ChromeAppCacheServiceTest() |
| 21 : message_loop_(MessageLoop::TYPE_IO), | 22 : message_loop_(MessageLoop::TYPE_IO), |
| 22 db_thread_(BrowserThread::DB, &message_loop_), | 23 db_thread_(BrowserThread::DB, &message_loop_), |
| 23 file_thread_(BrowserThread::FILE, &message_loop_), | 24 file_thread_(BrowserThread::FILE, &message_loop_), |
| 24 cache_thread_(BrowserThread::CACHE, &message_loop_), | 25 cache_thread_(BrowserThread::CACHE, &message_loop_), |
| 25 io_thread_(BrowserThread::IO, &message_loop_) { | 26 io_thread_(BrowserThread::IO, &message_loop_) { |
| 26 } | 27 } |
| 27 | 28 |
| 28 protected: | 29 protected: |
| 30 ScopedTestingBrowserProcess browser_process_; | |
| 31 | |
| 29 MessageLoop message_loop_; | 32 MessageLoop message_loop_; |
| 30 ScopedTempDir temp_dir_; | 33 ScopedTempDir temp_dir_; |
| 31 | 34 |
| 32 private: | 35 private: |
| 33 BrowserThread db_thread_; | 36 BrowserThread db_thread_; |
| 34 BrowserThread file_thread_; | 37 BrowserThread file_thread_; |
| 35 BrowserThread cache_thread_; | 38 BrowserThread cache_thread_; |
| 36 BrowserThread io_thread_; | 39 BrowserThread io_thread_; |
| 37 }; | 40 }; |
| 38 | 41 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 ASSERT_TRUE(file_util::PathExists(appcache_path)); | 93 ASSERT_TRUE(file_util::PathExists(appcache_path)); |
| 91 ASSERT_TRUE(file_util::PathExists(appcache_path.AppendASCII("Index"))); | 94 ASSERT_TRUE(file_util::PathExists(appcache_path.AppendASCII("Index"))); |
| 92 | 95 |
| 93 appcache_service = NULL; | 96 appcache_service = NULL; |
| 94 message_loop_.RunAllPending(); | 97 message_loop_.RunAllPending(); |
| 95 | 98 |
| 96 ASSERT_FALSE(file_util::PathExists(appcache_path)); | 99 ASSERT_FALSE(file_util::PathExists(appcache_path)); |
| 97 } | 100 } |
| 98 | 101 |
| 99 } // namespace appcache | 102 } // namespace appcache |
| OLD | NEW |