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

Side by Side Diff: chrome/browser/predictors/resource_prefetcher_unittest.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "chrome/browser/predictors/resource_prefetcher.h" 8 #include "chrome/browser/predictors/resource_prefetcher.h"
9 #include "chrome/browser/predictors/resource_prefetcher_manager.h" 9 #include "chrome/browser/predictors/resource_prefetcher_manager.h"
10 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 private: 45 private:
46 DISALLOW_COPY_AND_ASSIGN(TestResourcePrefetcher); 46 DISALLOW_COPY_AND_ASSIGN(TestResourcePrefetcher);
47 }; 47 };
48 48
49 49
50 // Delegate for ResourcePrefetcher. 50 // Delegate for ResourcePrefetcher.
51 class TestResourcePrefetcherDelegate : public ResourcePrefetcher::Delegate { 51 class TestResourcePrefetcherDelegate : public ResourcePrefetcher::Delegate {
52 public: 52 public:
53 explicit TestResourcePrefetcherDelegate(base::MessageLoop* loop) 53 explicit TestResourcePrefetcherDelegate(base::MessageLoop* loop)
54 : request_context_getter_(new net::TestURLRequestContextGetter( 54 : request_context_getter_(
55 loop->message_loop_proxy())) { } 55 new net::TestURLRequestContextGetter(loop->task_runner())) {}
56 ~TestResourcePrefetcherDelegate() { } 56 ~TestResourcePrefetcherDelegate() { }
57 57
58 net::URLRequestContext* GetURLRequestContext() override { 58 net::URLRequestContext* GetURLRequestContext() override {
59 return request_context_getter_->GetURLRequestContext(); 59 return request_context_getter_->GetURLRequestContext();
60 } 60 }
61 61
62 MOCK_METHOD2(ResourcePrefetcherFinished, 62 MOCK_METHOD2(ResourcePrefetcherFinished,
63 void(ResourcePrefetcher* prefetcher, 63 void(ResourcePrefetcher* prefetcher,
64 ResourcePrefetcher::RequestVector* requests)); 64 ResourcePrefetcher::RequestVector* requests));
65 65
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // We need to delete requests_ptr here, though it looks to be managed by the 352 // We need to delete requests_ptr here, though it looks to be managed by the
353 // scoped_ptr requests. The scoped_ptr requests releases itself and the raw 353 // scoped_ptr requests. The scoped_ptr requests releases itself and the raw
354 // pointer requests_ptr is passed to ResourcePrefetcherFinished(). In the 354 // pointer requests_ptr is passed to ResourcePrefetcherFinished(). In the
355 // test, ResourcePrefetcherFinished() is a mock function and does not handle 355 // test, ResourcePrefetcherFinished() is a mock function and does not handle
356 // the raw pointer properly. In the real code, requests_ptr will eventually be 356 // the raw pointer properly. In the real code, requests_ptr will eventually be
357 // passed to and managed by ResourcePrefetchPredictor::Result::Result. 357 // passed to and managed by ResourcePrefetchPredictor::Result::Result.
358 delete requests_ptr; 358 delete requests_ptr;
359 } 359 }
360 360
361 } // namespace predictors 361 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/policy/profile_policy_connector_unittest.cc ('k') | chrome/browser/prefs/leveldb_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698