Chromium Code Reviews| Index: extensions/browser/preload_check_test_util.cc |
| diff --git a/extensions/browser/preload_check_test_util.cc b/extensions/browser/preload_check_test_util.cc |
| index f5becf43ae4a7173c854c744f33c495fd2992565..7ef49cab36e52b87f7ad067933a447e125514451 100644 |
| --- a/extensions/browser/preload_check_test_util.cc |
| +++ b/extensions/browser/preload_check_test_util.cc |
| @@ -36,8 +36,7 @@ void PreloadCheckRunner::RunUntilComplete(PreloadCheck* check) { |
| Run(check); |
| ASSERT_FALSE(called_); |
| - run_loop_ = base::MakeUnique<base::RunLoop>(); |
| - run_loop_->Run(); |
| + WaitForComplete(); |
|
Devlin
2017/04/06 02:03:53
Just a note - currently this is incompatible with
michaelpg
2017/04/06 22:31:16
RunUntilComplete requires the check to be async, t
|
| ASSERT_TRUE(called_); |
| } |
| @@ -51,18 +50,20 @@ void PreloadCheckRunner::WaitForIdle() { |
| run_loop_->RunUntilIdle(); |
| } |
| +void PreloadCheckRunner::WaitForComplete() { |
| + run_loop_ = base::MakeUnique<base::RunLoop>(); |
| + run_loop_->Run(); |
| +} |
| + |
| // PreloadCheckStub: |
| -PreloadCheckStub::PreloadCheckStub() |
| - : PreloadCheck(nullptr), is_async_(false), weak_ptr_factory_(this) {} |
| +PreloadCheckStub::PreloadCheckStub(const Errors& errors) |
| + : PreloadCheck(nullptr), errors_(errors), weak_ptr_factory_(this) {} |
| PreloadCheckStub::~PreloadCheckStub() {} |
| -void PreloadCheckStub::AddError(Error error) { |
| - errors_.insert(error); |
| -} |
| - |
| void PreloadCheckStub::Start(ResultCallback callback) { |
| DCHECK(!callback.is_null()); |
| + started_ = true; |
| if (is_async_) { |
| // TODO(michaelpg): Bind the callback directly and remove RunCallback |
| // once crbug.com/704027 is addressed. |
| @@ -79,8 +80,4 @@ void PreloadCheckStub::RunCallback(ResultCallback callback) { |
| std::move(callback).Run(errors_); |
| } |
| -base::string16 PreloadCheckStub::GetErrorMessage() const { |
| - return message_; |
| -} |
| - |
| } // namespace extensions |