| 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 b12bc17950de05927ec82b86c69a8736e5b65232..6ba3b1d30ac9fccba7c9f3ac669d25c1b73fc87f 100644
|
| --- a/extensions/browser/preload_check_test_util.cc
|
| +++ b/extensions/browser/preload_check_test_util.cc
|
| @@ -9,10 +9,14 @@
|
| #include "base/logging.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/run_loop.h"
|
| +#include "base/single_thread_task_runner.h"
|
| +#include "base/threading/thread_task_runner_handle.h"
|
| +#include "extensions/common/extension.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| namespace extensions {
|
|
|
| +// PreloadCheckRunner:
|
| PreloadCheckRunner::PreloadCheckRunner() : called_(false) {}
|
| PreloadCheckRunner::~PreloadCheckRunner() {}
|
|
|
| @@ -47,4 +51,33 @@ void PreloadCheckRunner::WaitForIdle() {
|
| run_loop_->RunUntilIdle();
|
| }
|
|
|
| +// PreloadCheckStub:
|
| +PreloadCheckStub::PreloadCheckStub(bool is_async)
|
| + : PreloadCheck(nullptr), is_async_(is_async) {}
|
| +
|
| +PreloadCheckStub::~PreloadCheckStub() {}
|
| +
|
| +void PreloadCheckStub::AddError(Error error) {
|
| + errors_.insert(error);
|
| +}
|
| +
|
| +void PreloadCheckStub::Start(ResultCallback callback) {
|
| + DCHECK(!callback.is_null());
|
| + if (is_async_) {
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE, base::Bind(&PreloadCheckStub::StartInternal,
|
| + base::Unretained(this), base::Passed(&callback)));
|
| + } else {
|
| + StartInternal(std::move(callback));
|
| + }
|
| +}
|
| +
|
| +void PreloadCheckStub::StartInternal(ResultCallback callback) {
|
| + std::move(callback).Run(errors_);
|
| +}
|
| +
|
| +base::string16 PreloadCheckStub::GetErrorMessage() const {
|
| + return message_;
|
| +}
|
| +
|
| } // namespace extensions
|
|
|