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

Side by Side Diff: chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
91 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { 91 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() {
92 return io_message_loop_proxy_; 92 return io_message_loop_proxy_;
93 } 93 }
94 94
95 protected: 95 protected:
96 virtual void SetUp() { 96 virtual void SetUp() {
97 testing::Test::SetUp(); 97 testing::Test::SetUp();
98 98
99 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); 99 io_message_loop_proxy_ = base::MessageLoopProxy::current();
100 } 100 }
101 101
102 virtual void TearDown() { 102 virtual void TearDown() {
103 fetcher_ = NULL; 103 fetcher_ = NULL;
104 // Deleting the fetcher causes a task to be posted to the IO thread to 104 // Deleting the fetcher causes a task to be posted to the IO thread to
105 // release references to the URLRequestContextGetter. We need to run all 105 // release references to the URLRequestContextGetter. We need to run all
106 // pending tasks to execute that (this is the IO thread). 106 // pending tasks to execute that (this is the IO thread).
107 MessageLoop::current()->RunAllPending(); 107 MessageLoop::current()->RunAllPending();
108 EXPECT_EQ(0, g_request_context_getter_instances); 108 EXPECT_EQ(0, g_request_context_getter_instances);
109 } 109 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 manager->OverrideEntryForTests(url, entry); 353 manager->OverrideEntryForTests(url, entry);
354 354
355 CreateFetcher(url, 11); 355 CreateFetcher(url, 11);
356 356
357 MessageLoop::current()->Run(); 357 MessageLoop::current()->Run();
358 358
359 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); 359 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url);
360 } 360 }
361 361
362 } // namespace. 362 } // namespace.
OLDNEW
« no previous file with comments | « chrome/common/json_pref_store_unittest.cc ('k') | chrome/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698