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

Unified Diff: extensions/browser/preload_check_test_util.cc

Issue 2745433002: PreloadCheckGroup for managing multiple extension PreloadChecks (Closed)
Patch Set: rebase & updates Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/preload_check_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6ba3b1d30ac9fccba7c9f3ac669d25c1b73fc87f..0ea1a94ff2b073f161d63650f1e213a42d6b3e66 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();
ASSERT_TRUE(called_);
}
@@ -51,9 +50,17 @@ void PreloadCheckRunner::WaitForIdle() {
run_loop_->RunUntilIdle();
}
+void PreloadCheckRunner::WaitForComplete() {
+ run_loop_ = base::MakeUnique<base::RunLoop>();
+ run_loop_->Run();
+}
+
// PreloadCheckStub:
-PreloadCheckStub::PreloadCheckStub(bool is_async)
- : PreloadCheck(nullptr), is_async_(is_async) {}
+PreloadCheckStub::PreloadCheckStub(bool is_async, const Errors& errors)
+ : PreloadCheck(nullptr),
+ is_async_(is_async),
+ errors_(errors),
+ started_(false) {}
PreloadCheckStub::~PreloadCheckStub() {}
@@ -63,6 +70,7 @@ void PreloadCheckStub::AddError(Error error) {
void PreloadCheckStub::Start(ResultCallback callback) {
DCHECK(!callback.is_null());
+ started_ = true;
if (is_async_) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&PreloadCheckStub::StartInternal,
@@ -76,8 +84,10 @@ void PreloadCheckStub::StartInternal(ResultCallback callback) {
std::move(callback).Run(errors_);
}
+/*
base::string16 PreloadCheckStub::GetErrorMessage() const {
return message_;
}
+*/
} // namespace extensions
« no previous file with comments | « extensions/browser/preload_check_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698