OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 CHROME_BROWSER_COMPONENT_UPDATER_TEST_TEST_CONFIGURATOR_H_ | |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_TEST_TEST_CONFIGURATOR_H_ | |
7 | |
8 #include <string> | |
9 #include <utility> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/callback.h" | |
13 #include "base/compiler_specific.h" | |
14 #include "base/memory/ref_counted.h" | |
15 #include "components/component_updater/component_updater_configurator.h" | |
16 #include "net/url_request/url_request_test_util.h" | |
17 | |
18 namespace component_updater { | |
19 | |
20 #define POST_INTERCEPT_SCHEME "https" | |
21 #define POST_INTERCEPT_HOSTNAME "localhost2" | |
22 #define POST_INTERCEPT_PATH "/update2" | |
23 | |
24 struct CrxComponent; | |
25 | |
26 class TestConfigurator : public Configurator { | |
27 public: | |
28 TestConfigurator(); | |
29 virtual ~TestConfigurator(); | |
30 | |
31 // Overrrides for Configurator. | |
32 virtual int InitialDelay() const OVERRIDE; | |
33 virtual int NextCheckDelay() OVERRIDE; | |
34 virtual int StepDelay() const OVERRIDE; | |
35 virtual int StepDelayMedium() OVERRIDE; | |
36 virtual int MinimumReCheckWait() const OVERRIDE; | |
37 virtual int OnDemandDelay() const OVERRIDE; | |
38 virtual GURL UpdateUrl() const OVERRIDE; | |
39 virtual GURL PingUrl() const OVERRIDE; | |
40 virtual base::Version GetBrowserVersion() const OVERRIDE; | |
41 virtual std::string GetChannel() const OVERRIDE; | |
42 virtual std::string GetLang() const OVERRIDE; | |
43 virtual std::string GetOSLongName() const OVERRIDE; | |
44 virtual std::string ExtraRequestParams() const OVERRIDE; | |
45 virtual size_t UrlSizeLimit() const OVERRIDE; | |
46 virtual net::URLRequestContextGetter* RequestContext() const OVERRIDE; | |
47 virtual scoped_refptr<OutOfProcessPatcher> CreateOutOfProcessPatcher() | |
48 const OVERRIDE; | |
49 virtual bool DeltasEnabled() const OVERRIDE; | |
50 virtual bool UseBackgroundDownloader() const OVERRIDE; | |
51 virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() | |
52 const OVERRIDE; | |
53 virtual scoped_refptr<base::SingleThreadTaskRunner> | |
54 GetSingleThreadTaskRunner() const OVERRIDE; | |
55 | |
56 typedef std::pair<CrxComponent*, int> CheckAtLoopCount; | |
57 void SetLoopCount(int times); | |
58 void SetRecheckTime(int seconds); | |
59 void SetOnDemandTime(int seconds); | |
60 void SetQuitClosure(const base::Closure& quit_closure); | |
61 void SetInitialDelay(int seconds); | |
62 | |
63 private: | |
64 int initial_time_; | |
65 int times_; | |
66 int recheck_time_; | |
67 int ondemand_time_; | |
68 | |
69 scoped_refptr<net::TestURLRequestContextGetter> context_; | |
70 base::Closure quit_closure_; | |
71 | |
72 DISALLOW_COPY_AND_ASSIGN(TestConfigurator); | |
73 }; | |
74 | |
75 } // namespace component_updater | |
76 | |
77 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_TEST_CONFIGURATOR_H_ | |
OLD | NEW |