This source file includes following definitions.
- SetUpCommandLine
- IN_PROC_BROWSER_TEST_F
#include "base/command_line.h"
#include "base/prefs/pref_service.h"
#include "base/values.h"
#include "chrome/browser/managed_mode/managed_user_constants.h"
#include "chrome/browser/managed_mode/managed_user_service.h"
#include "chrome/browser/managed_mode/managed_user_service_factory.h"
#include "chrome/browser/managed_mode/managed_user_settings_service.h"
#include "chrome/browser/managed_mode/managed_user_settings_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/common/chrome_switches.h"
class SingleClientManagedUserSettingsSyncTest : public SyncTest {
public:
SingleClientManagedUserSettingsSyncTest() : SyncTest(SINGLE_CLIENT) {}
virtual ~SingleClientManagedUserSettingsSyncTest() {}
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
SyncTest::SetUpCommandLine(command_line);
command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf");
}
};
IN_PROC_BROWSER_TEST_F(SingleClientManagedUserSettingsSyncTest, Sanity) {
ASSERT_TRUE(SetupClients());
for (int i = 0; i < num_clients(); ++i) {
Profile* profile = GetProfile(i);
ManagedUserSettingsService* settings_service =
ManagedUserSettingsServiceFactory::GetForProfile(profile);
scoped_ptr<base::Value> allow_signin(new base::FundamentalValue(true));
settings_service->SetLocalSettingForTesting(managed_users::kSigninAllowed,
allow_signin.Pass());
std::string username;
std::string password = "password";
GetClient(i)->SetCredentials(username, password);
}
ASSERT_TRUE(SetupSync());
}