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

Side by Side Diff: headless/public/util/testing/fake_managed_dispatch_url_request_job.h

Issue 2260793002: Headless utility classes for making deterministic protocol handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 4 years, 4 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 2016 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 HEADLESS_PUBLIC_UTIL_TESTING_FAKE_MANAGED_DISPATCH_URL_REQUEST_JOB_H_
6 #define HEADLESS_PUBLIC_UTIL_TESTING_FAKE_MANAGED_DISPATCH_URL_REQUEST_JOB_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/macros.h"
12 #include "base/strings/stringprintf.h"
13 #include "headless/public/util/managed_dispatch_url_request_job.h"
14 #include "net/base/net_errors.h"
15
16 namespace headless {
17
18 class URLRequestDispatcher;
19
20 class FakeManagedDispatchURLRequestJob : public ManagedDispatchURLRequestJob {
21 public:
22 FakeManagedDispatchURLRequestJob(URLRequestDispatcher* url_request_dispatcher,
23 int id,
24 std::vector<std::string>* notifications)
25 : ManagedDispatchURLRequestJob(nullptr, nullptr, url_request_dispatcher),
26 id_(id),
27 notifications_(notifications) {}
28
29 ~FakeManagedDispatchURLRequestJob() override {}
30
31 using ManagedDispatchURLRequestJob::DispatchHeadersComplete;
32 using ManagedDispatchURLRequestJob::DispatchStartError;
33
34 void Start() override {}
35
36 void OnHeadersComplete() override;
37
38 void OnStartError(net::Error error) override;
39
40 private:
41 int id_;
42 std::vector<std::string>* notifications_; // NOT OWNED
43
44 DISALLOW_COPY_AND_ASSIGN(FakeManagedDispatchURLRequestJob);
45 };
46
47 } // namespace headless
48
49 #endif // HEADLESS_PUBLIC_UTIL_TESTING_FAKE_MANAGED_DISPATCH_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698