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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/fuzzer/clear_site_data_fuzzer.cc
diff --git a/content/test/fuzzer/clear_site_data_fuzzer.cc b/content/test/fuzzer/clear_site_data_fuzzer.cc
index a0cc6b27648eabc9620a94ff0b356cc11710c68b..30847f35b3ef9e7d0dff1af9fd4fd53cdbaad347 100644
--- a/content/test/fuzzer/clear_site_data_fuzzer.cc
+++ b/content/test/fuzzer/clear_site_data_fuzzer.cc
@@ -4,34 +4,24 @@
#include <stddef.h>
#include <stdint.h>
-#include <vector>
+#include <string>
#include "content/browser/browsing_data/clear_site_data_throttle.h"
namespace content {
-class ClearSiteDataFuzzerTest {
- public:
- ClearSiteDataFuzzerTest() : throttle_(nullptr) {}
-
- void TestHeader(const std::string& header) {
- bool remove_cookies;
- bool remove_storage;
- bool remove_cache;
- std::vector<content::ClearSiteDataThrottle::ConsoleMessage> messages;
-
- throttle_.ParseHeader(header, &remove_cookies, &remove_storage,
- &remove_cache, &messages);
- }
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ std::string header(reinterpret_cast<const char*>(data), size);
- private:
- content::ClearSiteDataThrottle throttle_;
-};
+ bool remove_cookies;
+ bool remove_storage;
+ bool remove_cache;
+ ClearSiteDataThrottle::ConsoleMessagesDelegate delegate_;
-ClearSiteDataFuzzerTest* test = new ClearSiteDataFuzzerTest();
+ content::ClearSiteDataThrottle::ParseHeaderForTesting(
+ header, &remove_cookies, &remove_storage, &remove_cache, &delegate_,
+ GURL());
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- test->TestHeader(std::string(reinterpret_cast<const char*>(data), size));
return 0;
}
« 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