#include <stdint.h>
#include "base/base64.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/task/current_thread.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.h"
#include "base/threading/thread.h"
#include "components/gcm_driver/crypto/gcm_decryption_result.h"
#include "components/gcm_driver/crypto/gcm_encryption_provider.h"
#include "components/gcm_driver/crypto/gcm_encryption_result.h"
#include "components/gcm_driver/fake_gcm_client_factory.h"
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/gcm_driver_desktop.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "crypto/ec_private_key.h"
#include "net/url_request/url_request_test_util.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "services/network/test/test_url_loader_factory.h"
#include "services/network/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gcm {
namespace {
const char kTestAppID1[] = …;
void PumpCurrentLoop() { … }
}
class GCMDriverBaseTest : public testing::Test { … };
GCMDriverBaseTest::GCMDriverBaseTest() : … { … }
GCMDriverBaseTest::~GCMDriverBaseTest() = default;
void GCMDriverBaseTest::SetUp() { … }
void GCMDriverBaseTest::TearDown() { … }
void GCMDriverBaseTest::PumpIOLoop() { … }
void GCMDriverBaseTest::CreateDriver() { … }
void GCMDriverBaseTest::ShutdownDriver() { … }
void GCMDriverBaseTest::GetEncryptionInfo(const std::string& app_id,
WaitToFinish wait_to_finish) { … }
void GCMDriverBaseTest::EncryptMessage(const std::string& app_id,
const std::string& authorized_entity,
const std::string& p256dh,
const std::string& auth_secret,
const std::string& message,
WaitToFinish wait_to_finish) { … }
void GCMDriverBaseTest::DecryptMessage(const std::string& app_id,
const std::string& authorized_entity,
const std::string& message,
WaitToFinish wait_to_finish) { … }
void GCMDriverBaseTest::GetEncryptionInfoCompleted(std::string p256dh,
std::string auth_secret) { … }
void GCMDriverBaseTest::EncryptMessageCompleted(GCMEncryptionResult result,
std::string message) { … }
void GCMDriverBaseTest::DecryptMessageCompleted(GCMDecryptionResult result,
std::string message) { … }
TEST_F(GCMDriverBaseTest, EncryptionDecryptionRoundTrip) { … }
TEST_F(GCMDriverBaseTest, EncryptionError) { … }
}