#include "chrome/browser/enterprise/remote_commands/clear_browsing_data_job.h"
#include "base/json/json_writer.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/common/buildflags.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace enterprise_commands {
namespace {
const char kProfileName[] = …;
const char kProfileNameLowerCase[] = …;
const policy::RemoteCommandJob::UniqueIDType kUniqueID = …;
const char kTestProfilePath[] = …;
const char kProfilePathField[] = …;
const char kClearCacheField[] = …;
const char kClearCookiesField[] = …;
enterprise_management::RemoteCommand CreateCommandProto(
const std::string& profile_path,
bool clear_cache,
bool clear_cookies) { … }
void InitJob(ClearBrowsingDataJob* job,
const enterprise_management::RemoteCommand& command_proto) { … }
std::unique_ptr<ClearBrowsingDataJob> CreateJob(
const enterprise_management::RemoteCommand& command_proto,
ProfileManager* profile_manager) { … }
std::unique_ptr<ClearBrowsingDataJob> CreateJob(
const enterprise_management::RemoteCommand& command_proto,
Profile* profile) { … }
}
class ClearBrowsingDataJobTest : public ::testing::Test { … };
TEST_F(ClearBrowsingDataJobTest, CanParseWithMissingDataTypes) { … }
TEST_F(ClearBrowsingDataJobTest, DontInitWhenMissingProfilePath) { … }
TEST_F(ClearBrowsingDataJobTest, FailureWhenProfileDoesntExist) { … }
TEST_F(ClearBrowsingDataJobTest, SuccessClearCookies) { … }
TEST_F(ClearBrowsingDataJobTest, SuccessClearBoth) { … }
TEST_F(ClearBrowsingDataJobTest, SuccessClearCache) { … }
TEST_F(ClearBrowsingDataJobTest, SuccessClearNeither) { … }
TEST_F(ClearBrowsingDataJobTest, SucessClearWithProfile) { … }
TEST_F(ClearBrowsingDataJobTest, HandleProfilPathCaseSensitivity) { … }
}