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

Side by Side Diff: content/common/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
« no previous file with comments | « content/common/url_fetcher.cc ('k') | content/renderer/media/capture_video_decoder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop_proxy.h" 5 #include "base/message_loop_proxy.h"
6 #include "base/synchronization/waitable_event.h" 6 #include "base/synchronization/waitable_event.h"
7 #include "base/threading/thread.h" 7 #include "base/threading/thread.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/common/url_fetcher.h" 9 #include "content/common/url_fetcher.h"
10 #include "crypto/nss_util.h" 10 #include "crypto/nss_util.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 const std::string& data); 88 const std::string& data);
89 89
90 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { 90 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() {
91 return io_message_loop_proxy_; 91 return io_message_loop_proxy_;
92 } 92 }
93 93
94 protected: 94 protected:
95 virtual void SetUp() { 95 virtual void SetUp() {
96 testing::Test::SetUp(); 96 testing::Test::SetUp();
97 97
98 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); 98 io_message_loop_proxy_ = base::MessageLoopProxy::current();
99 99
100 #if defined(USE_NSS) 100 #if defined(USE_NSS)
101 crypto::EnsureNSSInit(); 101 crypto::EnsureNSSInit();
102 net::EnsureOCSPInit(); 102 net::EnsureOCSPInit();
103 #endif 103 #endif
104 } 104 }
105 105
106 virtual void TearDown() { 106 virtual void TearDown() {
107 #if defined(USE_NSS) 107 #if defined(USE_NSS)
108 net::ShutdownOCSP(); 108 net::ShutdownOCSP();
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 FROM_HERE, 897 FROM_HERE,
898 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current())); 898 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current()));
899 MessageLoop::current()->Run(); 899 MessageLoop::current()->Run();
900 EXPECT_EQ(1, GetNumFetcherCores()); 900 EXPECT_EQ(1, GetNumFetcherCores());
901 URLFetcher::CancelAll(); 901 URLFetcher::CancelAll();
902 EXPECT_EQ(0, GetNumFetcherCores()); 902 EXPECT_EQ(0, GetNumFetcherCores());
903 delete fetcher_; 903 delete fetcher_;
904 } 904 }
905 905
906 } // namespace. 906 } // namespace.
OLDNEW
« no previous file with comments | « content/common/url_fetcher.cc ('k') | content/renderer/media/capture_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698