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

Unified Diff: content/browser/storage_partition_impl_unittest.cc

Issue 14197014: Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT Created 7 years, 6 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/storage_partition_impl_unittest.cc
diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc
index 631ac7b749ca01437ac6d4ac19bdeeada7ee70b5..0298513929900eb84174da0a7c9c989ceb7ddec9 100644
--- a/content/browser/storage_partition_impl_unittest.cc
+++ b/content/browser/storage_partition_impl_unittest.cc
@@ -10,7 +10,7 @@
#include "content/browser/gpu/shader_disk_cache.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/storage_partition.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "net/base/test_completion_callback.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -50,10 +50,8 @@ const char kCacheValue[] = "cached value";
class StoragePartitionShaderClearTest : public testing::Test {
public:
- StoragePartitionShaderClearTest() :
- ui_thread_(BrowserThread::UI, &message_loop_),
- cache_thread_(BrowserThread::CACHE, &message_loop_),
- io_thread_(BrowserThread::IO, &message_loop_) {
+ StoragePartitionShaderClearTest()
+ : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
}
virtual ~StoragePartitionShaderClearTest() {}
@@ -85,8 +83,6 @@ class StoragePartitionShaderClearTest : public testing::Test {
size_t Size() { return cache_->Size(); }
- base::MessageLoop* message_loop() { return &message_loop_; }
-
private:
virtual void TearDown() OVERRIDE {
cache_ = NULL;
@@ -94,10 +90,7 @@ class StoragePartitionShaderClearTest : public testing::Test {
}
base::ScopedTempDir temp_dir_;
- base::MessageLoopForIO message_loop_;
- TestBrowserThread ui_thread_;
- TestBrowserThread cache_thread_;
- TestBrowserThread io_thread_;
+ content::TestBrowserThreadBundle thread_bundle_;
scoped_refptr<ShaderDiskCache> cache_;
};
@@ -115,8 +108,9 @@ TEST_F(StoragePartitionShaderClearTest, ClearShaderCache) {
TestClosureCallback clear_cb;
StoragePartitionImpl sp(cache_path(), NULL, NULL, NULL, NULL, NULL, NULL);
- message_loop()->PostTask(FROM_HERE,
- base::Bind(&ClearData, &sp, clear_cb.callback()));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&ClearData, &sp, clear_cb.callback()));
clear_cb.WaitForResult();
EXPECT_EQ(0u, Size());
}

Powered by Google App Engine
This is Rietveld 408576698