This source file includes following definitions.
- SetUpCommandLine
- SetUpCommandLine
- SetUpCommandLine
- SetUpCommandLine
- SetUpOnMainThread
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
#include "ash/shell.h"
#include "base/command_line.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/login/login_display_host_impl.h"
#include "chrome/browser/chromeos/login/login_wizard.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/tracing.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chromeos/chromeos_switches.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_system.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using ::testing::_;
using ::testing::AnyNumber;
using ::testing::Return;
namespace {
class LoginUserTest : public InProcessBrowserTest {
protected:
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitchASCII(
chromeos::switches::kLoginUser, "TestUser@gmail.com");
command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user");
}
};
class LoginGuestTest : public InProcessBrowserTest {
protected:
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitch(chromeos::switches::kGuestSession);
command_line->AppendSwitch(::switches::kIncognito);
command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user");
command_line->AppendSwitchASCII(chromeos::switches::kLoginUser,
chromeos::UserManager::kGuestUserName);
}
};
class LoginCursorTest : public InProcessBrowserTest {
protected:
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitch(chromeos::switches::kLoginManager);
}
};
class LoginSigninTest : public InProcessBrowserTest {
protected:
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitch(chromeos::switches::kLoginManager);
command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests);
}
virtual void SetUpOnMainThread() OVERRIDE {
ASSERT_TRUE(tracing::BeginTracingWithWatch("ui", "ui", "ShowLoginWebUI", 1));
}
};
IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) {
Profile* profile = browser()->profile();
EXPECT_EQ("user", profile->GetPath().BaseName().value());
EXPECT_FALSE(profile->IsOffTheRecord());
}
IN_PROC_BROWSER_TEST_F(LoginUserTest, CursorShown) {
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
}
IN_PROC_BROWSER_TEST_F(LoginGuestTest, GuestIsOTR) {
Profile* profile = browser()->profile();
EXPECT_TRUE(profile->IsOffTheRecord());
EXPECT_TRUE(extensions::ExtensionSystem::Get(profile)->extension_service());
}
IN_PROC_BROWSER_TEST_F(LoginGuestTest, CursorShown) {
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
}
IN_PROC_BROWSER_TEST_F(LoginCursorTest, CursorHidden) {
chromeos::ShowLoginWizard(chromeos::WizardController::kLoginScreenName);
EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
EXPECT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point()));
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
base::MessageLoop::current()->DeleteSoon(
FROM_HERE, chromeos::LoginDisplayHostImpl::default_host());
}
IN_PROC_BROWSER_TEST_F(LoginSigninTest, WebUIVisible) {
base::TimeDelta no_timeout;
EXPECT_TRUE(tracing::WaitForWatchEvent(no_timeout));
std::string json_events;
ASSERT_TRUE(tracing::EndTracing(&json_events));
}
}