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

Side by Side Diff: extensions/browser/preload_check_test_util.h

Issue 2693373003: PreloadCheck class for extension pre-install checks (Closed)
Patch Set: devlin 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 unified diff | Download patch
OLDNEW
(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 "extensions/browser/preload_check.h"
9
10 namespace extensions {
11
12 // Provides a callback method for a PreloadCheck that stores its results.
13 class PreloadCheckRunner {
14 public:
15 PreloadCheckRunner();
16 virtual ~PreloadCheckRunner();
17
18 // Starts the check and waits for its callback to execute.
19 void RunUntilComplete(PreloadCheck* check);
20
21 // Waits to give asynchronous tasks a chance to complete.
22 void Wait();
23
24 PreloadCheck::ResultCallback GetCallback();
25
26 const PreloadCheck::Errors& errors() const { return errors_; }
27 bool called() const { return called_; }
28
29 private:
30 void OnCheckComplete(PreloadCheck::Errors errors);
31
32 PreloadCheck::Errors errors_;
33 bool called_;
34
35 DISALLOW_COPY_AND_ASSIGN(PreloadCheckRunner);
36 };
37
38 } // namespace extensions
39
40 #endif // EXTENSIONS_BROWSER_PRELOAD_CHECK_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698