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

Unified Diff: content/browser/browser_thread_unittest.cc

Issue 9086002: base::Bind: Remove Task. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix. Created 8 years, 12 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
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/public/browser/browser_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_thread_unittest.cc
diff --git a/content/browser/browser_thread_unittest.cc b/content/browser/browser_thread_unittest.cc
index 59ec5f7057a078bed8b931c0f4a4be15f3cb3c26..7bfe039f90d5d50ff2bedd9e8700363dc12708aa 100644
--- a/content/browser/browser_thread_unittest.cc
+++ b/content/browser/browser_thread_unittest.cc
@@ -41,21 +41,6 @@ class BrowserThreadTest : public testing::Test {
static void DoNothing() {
}
- class DummyTask : public Task {
- public:
- explicit DummyTask(bool* deleted) : deleted_(deleted) { }
- ~DummyTask() {
- *deleted_ = true;
- }
-
- void Run() {
- CHECK(false);
- }
-
- private:
- bool* deleted_;
- };
-
class DeletedOnFile
: public base::RefCountedThreadSafe<
DeletedOnFile, BrowserThread::DeleteOnFileThread> {
@@ -101,14 +86,6 @@ TEST_F(BrowserThreadTest, Release) {
MessageLoop::current()->Run();
}
-TEST_F(BrowserThreadTest, TaskToNonExistentThreadIsDeleted) {
- bool deleted = false;
- BrowserThread::PostTask(
- BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
- new DummyTask(&deleted));
- EXPECT_TRUE(deleted);
-}
-
TEST_F(BrowserThreadTest, ReleasedOnCorrectThread) {
{
scoped_refptr<DeletedOnFile> test(
@@ -148,42 +125,4 @@ TEST_F(BrowserThreadTest, PostTaskAndReply) {
MessageLoop::current()->Run();
}
-
-TEST_F(BrowserThreadTest, TaskToNonExistentThreadIsDeletedViaMessageLoopProxy) {
- bool deleted = false;
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy =
- BrowserThread::GetMessageLoopProxyForThread(
- BrowserThread::WEBKIT_DEPRECATED);
- message_loop_proxy->PostTask(FROM_HERE, new DummyTask(&deleted));
- EXPECT_TRUE(deleted);
-}
-
-TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxyAfterThreadExits) {
- scoped_ptr<BrowserThreadImpl> io_thread(
- new BrowserThreadImpl(BrowserThread::IO));
- io_thread->Start();
- io_thread->Stop();
-
- bool deleted = false;
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy =
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
- bool ret = message_loop_proxy->PostTask(FROM_HERE, new DummyTask(&deleted));
- EXPECT_FALSE(ret);
- EXPECT_TRUE(deleted);
-}
-
-TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxyAfterThreadIsDeleted) {
- {
- scoped_ptr<BrowserThreadImpl> io_thread(
- new BrowserThreadImpl(BrowserThread::IO));
- io_thread->Start();
- }
- bool deleted = false;
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy =
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
- bool ret = message_loop_proxy->PostTask(FROM_HERE, new DummyTask(&deleted));
- EXPECT_FALSE(ret);
- EXPECT_TRUE(deleted);
-}
-
}
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/public/browser/browser_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698