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

Unified Diff: extensions/browser/preload_check_test_util.h

Issue 2737053002: Update ExtensionInstallChecker to use PreloadCheck classes (Closed)
Patch Set: rebase 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
Index: extensions/browser/preload_check_test_util.h
diff --git a/extensions/browser/preload_check_test_util.h b/extensions/browser/preload_check_test_util.h
index 7da768af493ab4e0dccc8d0457ed6db558f801a8..025ef83099a02e0cd4d0c262753383f0a8658feb 100644
--- a/extensions/browser/preload_check_test_util.h
+++ b/extensions/browser/preload_check_test_util.h
@@ -7,6 +7,8 @@
#include <memory>
+#include "base/macros.h"
+#include "base/strings/string16.h"
#include "extensions/browser/preload_check.h"
namespace base {
@@ -51,6 +53,29 @@ class PreloadCheckRunner {
DISALLOW_COPY_AND_ASSIGN(PreloadCheckRunner);
};
+// Stub for a PreloadCheck that returns the desired error(s).
+class PreloadCheckStub : public PreloadCheck {
+ public:
+ explicit PreloadCheckStub(bool is_async = false);
+ ~PreloadCheckStub() override;
+
+ void AddError(Error error);
+ void set_error_message(const base::string16& message) { message_ = message; }
+
+ // PreloadCheck:
+ void Start(ResultCallback callback) override;
+ base::string16 GetErrorMessage() const override;
+
+ private:
+ void StartInternal(ResultCallback callback);
+
+ bool is_async_;
+ Errors errors_;
+ base::string16 message_;
+
+ DISALLOW_COPY_AND_ASSIGN(PreloadCheckStub);
+};
+
} // namespace extensions
#endif // EXTENSIONS_BROWSER_PRELOAD_CHECK_TEST_UTIL_H_
« no previous file with comments | « chrome/browser/extensions/extension_install_checker_unittest.cc ('k') | extensions/browser/preload_check_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698