chromium/base/json/json_value_serializer_unittest.cc

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

#include <memory>
#include <optional>
#include <string>
#include <string_view>

#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_reader.h"
#include "base/json/json_string_value_serializer.h"
#include "base/json/json_writer.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {

namespace {

// Some proper JSON to test with:
const char kProperJSON[] =;

// Some proper JSON with trailing commas:
const char kProperJSONWithCommas[] =;

// kProperJSON with a few misc characters at the begin and end.
const char kProperJSONPadded[] =;

const char kWinLineEnds[] =;
const char kLinuxLineEnds[] =;

// Verifies the generated JSON against the expected output.
void CheckJSONIsStillTheSame(const Value& value) {}

void ValidateJsonList(const std::string& json) {}

// Test proper JSON deserialization from string is working.
TEST(JSONValueDeserializerTest, ReadProperJSONFromString) {}

// Test proper JSON deserialization from a std::string_view substring.
TEST(JSONValueDeserializerTest, ReadProperJSONFromStringPiece) {}

// Test that trialing commas are only properly deserialized from string when
// the proper flag for that is set.
TEST(JSONValueDeserializerTest, ReadJSONWithTrailingCommasFromString) {}

// Test proper JSON deserialization from file is working.
TEST(JSONValueDeserializerTest, ReadProperJSONFromFile) {}

// Test that trialing commas are only properly deserialized from file when
// the proper flag for that is set.
TEST(JSONValueDeserializerTest, ReadJSONWithCommasFromFile) {}

TEST(JSONValueDeserializerTest, AllowTrailingComma) {}

TEST(JSONValueSerializerTest, Roundtrip) {}

TEST(JSONValueSerializerTest, StringEscape) {}

TEST(JSONValueSerializerTest, UnicodeStrings) {}

TEST(JSONValueSerializerTest, HexStrings) {}

TEST(JSONValueSerializerTest, JSONReaderComments) {}

class JSONFileValueSerializerTest : public testing::Test {};

TEST_F(JSONFileValueSerializerTest, Roundtrip) {}

TEST_F(JSONFileValueSerializerTest, RoundtripNested) {}

TEST_F(JSONFileValueSerializerTest, NoWhitespace) {}

}  // namespace

}  // namespace base