chromium/components/url_formatter/url_formatter_unittest.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/url_formatter/url_formatter.h"

#include <stddef.h>
#include <string.h>

#include <vector>

#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace url_formatter {

namespace {

WideToUTF16;
ASCIIToUTF16;

const size_t kNpos =;

struct AdjustOffsetCase {};

struct UrlTestData {};

// A pair of helpers for the FormatUrlWithOffsets() test.
void VerboseExpect(size_t expected,
                   size_t actual,
                   const std::string& original_url,
                   size_t position,
                   const std::u16string& formatted_url) {}

void CheckAdjustedOffsets(const std::string& url_string,
                          FormatUrlTypes format_types,
                          base::UnescapeRule::Type unescape_rules,
                          const size_t* output_offsets) {}

}  // namespace

TEST(UrlFormatterTest, FormatUrl) {}

TEST(UrlFormatterTest, FormatUrlParsed) {}

// Make sure that calling FormatUrl on a GURL and then converting back to a GURL
// results in the original GURL, for each ASCII character in the path.
TEST(UrlFormatterTest, FormatUrlRoundTripPathASCII) {}

// Make sure that calling FormatUrl on a GURL and then converting back to a GURL
// results in a different GURL, for each escaped ASCII character in the path.
// GURL no longer unescapes percent-encoded ASCII characters. See
// https://crbug.com/1252531
TEST(UrlFormatterTest, FormatUrlRoundTripPathEscaped) {}

// Make sure that calling FormatUrl on a GURL and then converting back to a GURL
// results in the original GURL, for each ASCII character in the query.
TEST(UrlFormatterTest, FormatUrlRoundTripQueryASCII) {}

// Make sure that calling FormatUrl on a GURL and then converting back to a GURL
// only results in a different GURL for certain characters.
TEST(UrlFormatterTest, FormatUrlRoundTripQueryEscaped) {}

TEST(UrlFormatterTest, StripWWWFromHostComponent) {}

TEST(UrlFormatterTest, FormatUrlWithOffsets) {}

}  // namespace url_formatter