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

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

Issue 2248283008: Fix recursion bug in blocking a fetch and add a test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unintentional change 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ 5 #ifndef HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_
6 #define HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ 6 #define HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 GenericURLRequestJob::RewriteCallback callback) override; 37 GenericURLRequestJob::RewriteCallback callback) override;
38 38
39 const GenericURLRequestJob::HttpResponse* MaybeMatchResource( 39 const GenericURLRequestJob::HttpResponse* MaybeMatchResource(
40 const GURL& url, 40 const GURL& url,
41 const net::HttpRequestHeaders& request_headers) override; 41 const net::HttpRequestHeaders& request_headers) override;
42 42
43 void OnResourceLoadComplete(const GURL& final_url, 43 void OnResourceLoadComplete(const GURL& final_url,
44 const std::string& mime_type, 44 const std::string& mime_type,
45 int http_response_code) override; 45 int http_response_code) override;
46 46
47 void SetShouldBlock(bool should_block) { should_block_ = should_block; }
48
47 private: 49 private:
50 bool should_block_;
51
48 DISALLOW_COPY_AND_ASSIGN(MockGenericURLRequestJobDelegate); 52 DISALLOW_COPY_AND_ASSIGN(MockGenericURLRequestJobDelegate);
49 }; 53 };
50 54
51 // TODO(alexclarke): We may be able to replace this with the CookieMonster. 55 // TODO(alexclarke): We may be able to replace this with the CookieMonster.
52 class MockCookieStore : public net::CookieStore { 56 class MockCookieStore : public net::CookieStore {
53 public: 57 public:
54 MockCookieStore(); 58 MockCookieStore();
55 ~MockCookieStore() override; 59 ~MockCookieStore() override;
56 60
57 // net::CookieStore implementation: 61 // net::CookieStore implementation:
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 144
141 private: 145 private:
142 std::string response_data_; 146 std::string response_data_;
143 147
144 DISALLOW_COPY_AND_ASSIGN(MockURLRequestDelegate); 148 DISALLOW_COPY_AND_ASSIGN(MockURLRequestDelegate);
145 }; 149 };
146 150
147 } // namespace headless 151 } // namespace headless
148 152
149 #endif // HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ 153 #endif // HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_
OLDNEW
« no previous file with comments | « headless/public/util/managed_dispatch_url_request_job.h ('k') | headless/public/util/testing/generic_url_request_mocks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698