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

Unified Diff: extensions/browser/preload_check_test_util.cc

Issue 2783143005: Replace ExtensionInstallChecker with generic PreloadCheckGroup (Closed)
Patch Set: (no change) Created 3 years, 8 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
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
« extensions/browser/preload_check_test_util.h ('K') | « 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