OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef EXTENSIONS_BROWSER_PRELOAD_CHECK_TEST_UTIL_H_ | |
6 #define EXTENSIONS_BROWSER_PRELOAD_CHECK_TEST_UTIL_H_ | |
7 | |
8 #include "base/run_loop.h" | |
9 #include "extensions/browser/preload_check.h" | |
10 | |
11 namespace extensions { | |
12 | |
13 // Provides a callback method for a PreloadCheck that stores its results. | |
14 class PreloadCheckObserver { | |
15 public: | |
16 PreloadCheckObserver(); | |
17 virtual ~PreloadCheckObserver(); | |
18 | |
19 virtual void OnCheckComplete(PreloadCheck::Errors errors); | |
20 | |
21 void Wait() { | |
22 if (call_count_) | |
23 return; | |
24 | |
25 base::RunLoop().RunUntilIdle(); | |
Devlin
2017/03/08 03:01:48
We already have the object file, so may as well mo
michaelpg
2017/03/09 01:53:30
Doh.
| |
26 } | |
27 | |
28 const PreloadCheck::Errors& errors() const { return errors_; } | |
29 int call_count() const { return call_count_; } | |
30 | |
31 private: | |
32 PreloadCheck::Errors errors_; | |
33 int call_count_; | |
Devlin
2017/03/08 03:01:49
DISALLOW_COPY_AND_ASSIGN
michaelpg
2017/03/09 01:53:30
Done.
| |
34 }; | |
35 | |
36 } // namespace extensions | |
37 | |
38 #endif // EXTENSIONS_BROWSER_PRELOAD_CHECK_TEST_UTIL_H_ | |
OLD | NEW |