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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: headless/public/util/testing/fake_managed_dispatch_url_request_job.h
diff --git a/headless/public/util/testing/fake_managed_dispatch_url_request_job.h b/headless/public/util/testing/fake_managed_dispatch_url_request_job.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb0dabdf5b1212ecdd79883dc6c59afae4fc3558
--- /dev/null
+++ b/headless/public/util/testing/fake_managed_dispatch_url_request_job.h
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef HEADLESS_PUBLIC_UTIL_TESTING_FAKE_MANAGED_DISPATCH_URL_REQUEST_JOB_H_
+#define HEADLESS_PUBLIC_UTIL_TESTING_FAKE_MANAGED_DISPATCH_URL_REQUEST_JOB_H_
+
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/strings/stringprintf.h"
+#include "headless/public/util/managed_dispatch_url_request_job.h"
+#include "net/base/net_errors.h"
+
+namespace headless {
+
+class URLRequestDispatcher;
+
+class FakeManagedDispatchURLRequestJob : public ManagedDispatchURLRequestJob {
+ public:
+ FakeManagedDispatchURLRequestJob(URLRequestDispatcher* url_request_dispatcher,
+ int id,
+ std::vector<std::string>* notifications)
+ : ManagedDispatchURLRequestJob(nullptr, nullptr, url_request_dispatcher),
+ id_(id),
+ notifications_(notifications) {}
+
+ ~FakeManagedDispatchURLRequestJob() override {}
+
+ using ManagedDispatchURLRequestJob::DispatchHeadersComplete;
+ using ManagedDispatchURLRequestJob::DispatchStartError;
+
+ void Start() override {}
+
+ void OnHeadersComplete() override;
+
+ void OnStartError(net::Error error) override;
+
+ private:
+ int id_;
+ std::vector<std::string>* notifications_; // NOT OWNED
+
+ DISALLOW_COPY_AND_ASSIGN(FakeManagedDispatchURLRequestJob);
+};
+
+} // namespace headless
+
+#endif // HEADLESS_PUBLIC_UTIL_TESTING_FAKE_MANAGED_DISPATCH_URL_REQUEST_JOB_H_

Powered by Google App Engine
This is Rietveld 408576698