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

Side by Side Diff: content/test/fuzzer/clear_site_data_fuzzer.cc

Issue 2368923003: Support the Clear-Site-Data header on resource requests (Closed)
Patch Set: Addressed comments, formatted. Created 3 years, 6 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
« no previous file with comments | « content/test/data/browsing_data/worker_setup.html ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <vector> 7 #include <string>
8 8
9 #include "content/browser/browsing_data/clear_site_data_throttle.h" 9 #include "content/browser/browsing_data/clear_site_data_throttle.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 class ClearSiteDataFuzzerTest { 13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
14 public: 14 std::string header(reinterpret_cast<const char*>(data), size);
15 ClearSiteDataFuzzerTest() : throttle_(nullptr) {}
16 15
17 void TestHeader(const std::string& header) { 16 bool remove_cookies;
18 bool remove_cookies; 17 bool remove_storage;
19 bool remove_storage; 18 bool remove_cache;
20 bool remove_cache; 19 ClearSiteDataThrottle::ConsoleMessagesDelegate delegate_;
21 std::vector<content::ClearSiteDataThrottle::ConsoleMessage> messages;
22 20
23 throttle_.ParseHeader(header, &remove_cookies, &remove_storage, 21 content::ClearSiteDataThrottle::ParseHeaderForTesting(
24 &remove_cache, &messages); 22 header, &remove_cookies, &remove_storage, &remove_cache, &delegate_,
25 } 23 GURL());
26 24
27 private:
28 content::ClearSiteDataThrottle throttle_;
29 };
30
31 ClearSiteDataFuzzerTest* test = new ClearSiteDataFuzzerTest();
32
33 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
34 test->TestHeader(std::string(reinterpret_cast<const char*>(data), size));
35 return 0; 25 return 0;
36 } 26 }
37 27
38 } // namespace content 28 } // namespace content
OLDNEW
« no previous file with comments | « content/test/data/browsing_data/worker_setup.html ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698