Commit bf4231d4 authored by Piotr Pawliczek's avatar Piotr Pawliczek Committed by Commit Bot

Removes obsolete fuzzer for printer_configuration

This patch removes an obsolete fuzzer that checks operations
on URI set in PrinterConfiguration objects. Currently, these
functionality is tested by a fuzzer created for Uri class.

BUG=chromium:1106355
TEST=none

Change-Id: I0dd973d8c9626026e52495e6435d0d16a1e701dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2305215
Commit-Queue: Sean Kau <skau@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Auto-Submit: Piotr Pawliczek <pawliczek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797308}
parent 0d948142
...@@ -349,16 +349,6 @@ fuzzer_test("ppd_line_reader_fuzzer") { ...@@ -349,16 +349,6 @@ fuzzer_test("ppd_line_reader_fuzzer") {
deps = [ ":chromeos" ] deps = [ ":chromeos" ]
} }
# Commented out due to crbug.com/1106355
# fuzzer_test("printer_configuration_fuzzer") {
# sources = [ "printing/printer_configuration_fuzzer.cc" ]
# seed_corpus = "printing/uri_fuzzer_seed_corpus"
# deps = [
# ":chromeos",
# "//base",
# ]
# }
fuzzer_test("uri_fuzzer") { fuzzer_test("uri_fuzzer") {
sources = [ "printing/uri_fuzzer.cc" ] sources = [ "printing/uri_fuzzer.cc" ]
seed_corpus = "printing/uri_fuzzer_seed_corpus" seed_corpus = "printing/uri_fuzzer_seed_corpus"
......
// Copyright 2020 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.
#include <stddef.h>
#include <stdint.h>
#include <string>
#include "base/optional.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "chromeos/printing/printer_configuration.h"
#include "chromeos/printing/uri_components.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
chromeos::Printer printer("fuzz");
printer.set_uri(std::string(reinterpret_cast<const char*>(data), size));
printer.GetHostAndPort();
printer.GetProtocol();
base::Optional<chromeos::UriComponents> components =
printer.GetUriComponents();
if (components) {
bool encrypted = components->encrypted();
std::string scheme = components->scheme();
std::string host = components->host();
int port = components->port();
std::string path = components->path();
std::string reconstructed =
base::StrCat({encrypted ? "True" : "False", scheme, host,
base::NumberToString(port), path});
}
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment