chromium/third_party/libaddressinput/src/cpp/test/retriever_test.cc

// Copyright (C) 2013 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "retriever.h"

#include <libaddressinput/callback.h>
#include <libaddressinput/null_storage.h>
#include <libaddressinput/storage.h>

#include <cstddef>
#include <memory>
#include <string>

#include <gtest/gtest.h>

#include "mock_source.h"
#include "testdata_source.h"

#define CHECKSUM
#define DATA
#define OLD_TIMESTAMP

namespace {

BuildCallback;
MockSource;
NullStorage;
Retriever;
Storage;
TestdataSource;

const char kKey[] =;

// Empty data that the source can return.
const char kEmptyData[] =;

// The value of the data that the stale storage returns.
const char kStaleData[] =;

// The actual data that the stale storage returns.
const char kStaleWrappedData[] =;

// Tests for Retriever object.
class RetrieverTest : public testing::Test {};

TEST_F(RetrieverTest, RetrieveData) {}

TEST_F(RetrieverTest, ReadDataFromStorage) {}

TEST_F(RetrieverTest, MissingKeyReturnsEmptyData) {}

TEST_F(RetrieverTest, FaultySource) {}

// The storage that always returns stale data.
class StaleStorage : public Storage {};

TEST_F(RetrieverTest, UseStaleDataWhenSourceFails) {}

TEST_F(RetrieverTest, DoNotUseStaleDataWhenSourceSucceeds) {}

}  // namespace