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

Side by Side Diff: chrome/browser/captive_portal/testing_utils.h

Issue 242483003: Move CaptivePortalDetector to src/components/captive_portal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_CAPTIVE_PORTAL_TESTING_UTILS_H_
6 #define CHROME_BROWSER_CAPTIVE_PORTAL_TESTING_UTILS_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "chrome/browser/captive_portal/captive_portal_detector.h"
12 #include "net/url_request/test_url_fetcher_factory.h"
13
14 namespace base {
15 class Time;
16 }
17
18 namespace net {
19 class URLFetcher;
20 }
21
22 namespace captive_portal {
23
24 class CaptivePortalDetectorTestBase {
25 public:
26 CaptivePortalDetectorTestBase();
27 virtual ~CaptivePortalDetectorTestBase();
28
29 // Sets test time for captive portal detector.
30 void SetTime(const base::Time& time);
31
32 // Advances test time for captive portal detector.
33 void AdvanceTime(const base::TimeDelta& time_delta);
34
35 bool FetchingURL();
36
37 // Sets URL fetcher state and notifies portal detector.
38 void CompleteURLFetch(int net_error,
39 int status_code,
40 const char* response_headers);
41
42 void set_detector(CaptivePortalDetector* detector) { detector_ = detector; }
43
44 CaptivePortalDetector* detector() { return detector_; }
45
46 net::TestURLFetcher* fetcher() { return factory_.GetFetcherByID(0); }
47
48 protected:
49 CaptivePortalDetector* detector_;
50
51 net::TestURLFetcherFactory factory_;
52
53 DISALLOW_COPY_AND_ASSIGN(CaptivePortalDetectorTestBase);
54 };
55
56 } // namespace captive_portal
57
58 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_TESTING_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/browser/captive_portal/captive_portal_tab_reloader_unittest.cc ('k') | chrome/browser/captive_portal/testing_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698