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

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 637933002: Replace FINAL and OVERRIDE with their C++11 counterparts in chrome/test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | chrome/test/base/testing_profile_manager.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/test/base/testing_profile.h" 5 #include "chrome/test/base/testing_profile.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 using testing::NiceMock; 105 using testing::NiceMock;
106 using testing::Return; 106 using testing::Return;
107 107
108 namespace { 108 namespace {
109 109
110 // Used to make sure TopSites has finished loading 110 // Used to make sure TopSites has finished loading
111 class WaitTopSitesLoadedObserver : public history::TopSitesObserver { 111 class WaitTopSitesLoadedObserver : public history::TopSitesObserver {
112 public: 112 public:
113 explicit WaitTopSitesLoadedObserver(content::MessageLoopRunner* runner) 113 explicit WaitTopSitesLoadedObserver(content::MessageLoopRunner* runner)
114 : runner_(runner) {} 114 : runner_(runner) {}
115 virtual void TopSitesLoaded(history::TopSites* top_sites) OVERRIDE { 115 virtual void TopSitesLoaded(history::TopSites* top_sites) override {
116 runner_->Quit(); 116 runner_->Quit();
117 } 117 }
118 virtual void TopSitesChanged(history::TopSites* top_sites) OVERRIDE {} 118 virtual void TopSitesChanged(history::TopSites* top_sites) override {}
119 119
120 private: 120 private:
121 // weak 121 // weak
122 content::MessageLoopRunner* runner_; 122 content::MessageLoopRunner* runner_;
123 }; 123 };
124 124
125 // Task used to make sure history has finished processing a request. Intended 125 // Task used to make sure history has finished processing a request. Intended
126 // for use with BlockUntilHistoryProcessesPendingRequests. 126 // for use with BlockUntilHistoryProcessesPendingRequests.
127 127
128 class QuittingHistoryDBTask : public history::HistoryDBTask { 128 class QuittingHistoryDBTask : public history::HistoryDBTask {
129 public: 129 public:
130 QuittingHistoryDBTask() {} 130 QuittingHistoryDBTask() {}
131 131
132 virtual bool RunOnDBThread(history::HistoryBackend* backend, 132 virtual bool RunOnDBThread(history::HistoryBackend* backend,
133 history::HistoryDatabase* db) OVERRIDE { 133 history::HistoryDatabase* db) override {
134 return true; 134 return true;
135 } 135 }
136 136
137 virtual void DoneRunOnMainThread() OVERRIDE { 137 virtual void DoneRunOnMainThread() override {
138 base::MessageLoop::current()->Quit(); 138 base::MessageLoop::current()->Quit();
139 } 139 }
140 140
141 private: 141 private:
142 virtual ~QuittingHistoryDBTask() {} 142 virtual ~QuittingHistoryDBTask() {}
143 143
144 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); 144 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask);
145 }; 145 };
146 146
147 class TestExtensionURLRequestContext : public net::URLRequestContext { 147 class TestExtensionURLRequestContext : public net::URLRequestContext {
148 public: 148 public:
149 TestExtensionURLRequestContext() { 149 TestExtensionURLRequestContext() {
150 net::CookieMonster* cookie_monster = 150 net::CookieMonster* cookie_monster =
151 content::CreateCookieStore(content::CookieStoreConfig())-> 151 content::CreateCookieStore(content::CookieStoreConfig())->
152 GetCookieMonster(); 152 GetCookieMonster();
153 const char* const schemes[] = {extensions::kExtensionScheme}; 153 const char* const schemes[] = {extensions::kExtensionScheme};
154 cookie_monster->SetCookieableSchemes(schemes, arraysize(schemes)); 154 cookie_monster->SetCookieableSchemes(schemes, arraysize(schemes));
155 set_cookie_store(cookie_monster); 155 set_cookie_store(cookie_monster);
156 } 156 }
157 157
158 virtual ~TestExtensionURLRequestContext() { 158 virtual ~TestExtensionURLRequestContext() {
159 AssertNoURLRequests(); 159 AssertNoURLRequests();
160 } 160 }
161 }; 161 };
162 162
163 class TestExtensionURLRequestContextGetter 163 class TestExtensionURLRequestContextGetter
164 : public net::URLRequestContextGetter { 164 : public net::URLRequestContextGetter {
165 public: 165 public:
166 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE { 166 virtual net::URLRequestContext* GetURLRequestContext() override {
167 if (!context_.get()) 167 if (!context_.get())
168 context_.reset(new TestExtensionURLRequestContext()); 168 context_.reset(new TestExtensionURLRequestContext());
169 return context_.get(); 169 return context_.get();
170 } 170 }
171 virtual scoped_refptr<base::SingleThreadTaskRunner> 171 virtual scoped_refptr<base::SingleThreadTaskRunner>
172 GetNetworkTaskRunner() const OVERRIDE { 172 GetNetworkTaskRunner() const override {
173 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 173 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
174 } 174 }
175 175
176 protected: 176 protected:
177 virtual ~TestExtensionURLRequestContextGetter() {} 177 virtual ~TestExtensionURLRequestContextGetter() {}
178 178
179 private: 179 private:
180 scoped_ptr<net::URLRequestContext> context_; 180 scoped_ptr<net::URLRequestContext> context_;
181 }; 181 };
182 182
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 #if defined(ENABLE_EXTENSIONS) 1022 #if defined(ENABLE_EXTENSIONS)
1023 extension_policy_, 1023 extension_policy_,
1024 #endif 1024 #endif
1025 pref_service_.Pass(), 1025 pref_service_.Pass(),
1026 original_profile, 1026 original_profile,
1027 guest_session_, 1027 guest_session_,
1028 supervised_user_id_, 1028 supervised_user_id_,
1029 policy_service_.Pass(), 1029 policy_service_.Pass(),
1030 testing_factories_); 1030 testing_factories_);
1031 } 1031 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | chrome/test/base/testing_profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698