Chromium Code Reviews| 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 3ef1fd99de47f1f895b8304a5689e819924c6475..c2e512733b87cfc509292228599d1d34c00cea41 100644 |
| --- a/extensions/browser/preload_check_test_util.h |
| +++ b/extensions/browser/preload_check_test_util.h |
| @@ -30,13 +30,13 @@ class PreloadCheckRunner { |
| // Starts the check and waits for its callback to execute. |
| void RunUntilComplete(PreloadCheck* check); |
| - // Runs the message loop until OnCheckComplete is called. |
| - void WaitForCompletion(); |
| - |
| // Runs the message loop until idle. Useful to see whether OnCheckComplete is |
| // called without waiting indefinitely. |
| void WaitForIdle(); |
| + // Runs the message loop until OnCheckComplete is called. |
| + void WaitForComplete(); |
| + |
| PreloadCheck::ResultCallback GetCallback(); |
| const PreloadCheck::Errors& errors() const { return errors_; } |
| @@ -54,28 +54,24 @@ class PreloadCheckRunner { |
| DISALLOW_COPY_AND_ASSIGN(PreloadCheckRunner); |
| }; |
| -// Stub for a PreloadCheck that returns the desired error(s). |
| +// Stub for a PreloadCheck that calls the callback with the given error(s). |
| class PreloadCheckStub : public PreloadCheck { |
| public: |
| - PreloadCheckStub(); |
| + explicit PreloadCheckStub(const Errors& errors = Errors()); |
|
Devlin
2017/04/06 02:03:53
nit: I'd prefer we don't use default arguments on
michaelpg
2017/04/06 22:31:16
Done.
|
| ~PreloadCheckStub() override; |
| - void AddError(Error error); |
| - void set_error_message(const base::string16& message) { message_ = message; } |
| - |
| - bool is_async() const { return is_async_; } |
| void set_is_async(bool is_async) { is_async_ = is_async; } |
| + bool started() const { return started_; } |
| // PreloadCheck: |
| void Start(ResultCallback callback) override; |
| - base::string16 GetErrorMessage() const override; |
| private: |
| void RunCallback(ResultCallback callback); |
| bool is_async_ = false; |
| + bool started_ = false; |
| Errors errors_; |
| - base::string16 message_; |
| base::WeakPtrFactory<PreloadCheckStub> weak_ptr_factory_; |