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

Side by Side Diff: headless/test/headless_browser_test.cc

Issue 2255133002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « headless/public/internal/value_conversions.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "headless/test/headless_browser_test.h" 5 #include "headless/test/headless_browser_test.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 const std::string& script) { 162 const std::string& script) {
163 EvaluateHelper helper(this, web_contents, script); 163 EvaluateHelper helper(this, web_contents, script);
164 RunAsynchronousTest(); 164 RunAsynchronousTest();
165 return helper.TakeResult(); 165 return helper.TakeResult();
166 } 166 }
167 167
168 void HeadlessBrowserTest::RunAsynchronousTest() { 168 void HeadlessBrowserTest::RunAsynchronousTest() {
169 base::MessageLoop::ScopedNestableTaskAllower nestable_allower( 169 base::MessageLoop::ScopedNestableTaskAllower nestable_allower(
170 base::MessageLoop::current()); 170 base::MessageLoop::current());
171 EXPECT_FALSE(run_loop_); 171 EXPECT_FALSE(run_loop_);
172 run_loop_ = base::WrapUnique(new base::RunLoop()); 172 run_loop_ = base::MakeUnique<base::RunLoop>();
173 run_loop_->Run(); 173 run_loop_->Run();
174 run_loop_ = nullptr; 174 run_loop_ = nullptr;
175 } 175 }
176 176
177 void HeadlessBrowserTest::FinishAsynchronousTest() { 177 void HeadlessBrowserTest::FinishAsynchronousTest() {
178 run_loop_->Quit(); 178 run_loop_->Quit();
179 } 179 }
180 180
181 HeadlessAsyncDevTooledBrowserTest::HeadlessAsyncDevTooledBrowserTest() 181 HeadlessAsyncDevTooledBrowserTest::HeadlessAsyncDevTooledBrowserTest()
182 : web_contents_(nullptr), 182 : web_contents_(nullptr),
(...skipping 17 matching lines...) Expand all
200 200
201 web_contents_->GetDevToolsTarget()->DetachClient(devtools_client_.get()); 201 web_contents_->GetDevToolsTarget()->DetachClient(devtools_client_.get());
202 web_contents_->RemoveObserver(this); 202 web_contents_->RemoveObserver(this);
203 web_contents_->Close(); 203 web_contents_->Close();
204 web_contents_ = nullptr; 204 web_contents_ = nullptr;
205 browser_context_->Close(); 205 browser_context_->Close();
206 browser_context_ = nullptr; 206 browser_context_ = nullptr;
207 } 207 }
208 208
209 } // namespace headless 209 } // namespace headless
OLDNEW
« no previous file with comments | « headless/public/internal/value_conversions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698