| Index: chrome/browser/chromeos/policy/blocking_login_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/policy/blocking_login_browsertest.cc b/chrome/browser/chromeos/policy/blocking_login_browsertest.cc
|
| index 72db1d770d54726dfbc12819cc598cf26a1b2492..32757d7b842e5945205f3555dc14500dafe90807 100644
|
| --- a/chrome/browser/chromeos/policy/blocking_login_browsertest.cc
|
| +++ b/chrome/browser/chromeos/policy/blocking_login_browsertest.cc
|
| @@ -78,6 +78,7 @@ struct BlockingLoginTestParam {
|
| const int steps;
|
| const char* username;
|
| const bool enroll_device;
|
| + const bool use_webview;
|
| };
|
|
|
| class BlockingLoginTest
|
| @@ -87,14 +88,12 @@ class BlockingLoginTest
|
| public:
|
| BlockingLoginTest() : profile_added_(NULL) {
|
| // TODO(nkostylev): Fix this test for webview. http://crbug.com/477402
|
| - set_use_webview(false);
|
| + set_use_webview(GetParam().use_webview);
|
| }
|
|
|
| void SetUpCommandLine(base::CommandLine* command_line) override {
|
| OobeBaseTest::SetUpCommandLine(command_line);
|
|
|
| - command_line->AppendSwitchASCII(::switches::kAuthExtensionPath,
|
| - "gaia_auth");
|
| command_line->AppendSwitchASCII(
|
| policy::switches::kDeviceManagementUrl,
|
| embedded_test_server()->GetURL("/device_management").spec());
|
| @@ -132,19 +131,6 @@ class BlockingLoginTest
|
| ->browser_policy_connector_chromeos();
|
| }
|
|
|
| - void SkipToSigninScreen() {
|
| - WizardController::SkipPostLoginScreensForTesting();
|
| - WizardController* wizard_controller =
|
| - WizardController::default_controller();
|
| - ASSERT_TRUE(wizard_controller);
|
| - wizard_controller->SkipToLoginForTesting(LoginScreenContext());
|
| -
|
| - content::WindowedNotificationObserver(
|
| - chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
|
| - content::NotificationService::AllSources()).Wait();
|
| - RunUntilIdle();
|
| - }
|
| -
|
| void EnrollDevice(const std::string& username) {
|
| base::RunLoop loop;
|
| policy::EnterpriseInstallAttributes::LockResult result;
|
| @@ -268,7 +254,7 @@ IN_PROC_BROWSER_TEST_P(BlockingLoginTest, LoginBlocksForUser) {
|
|
|
| // Skip the OOBE, go to the sign-in screen, and wait for the login screen to
|
| // become visible.
|
| - SkipToSigninScreen();
|
| + WaitForSigninScreen();
|
| EXPECT_FALSE(profile_added_);
|
|
|
| // Prepare the fake HTTP responses.
|
| @@ -295,10 +281,12 @@ IN_PROC_BROWSER_TEST_P(BlockingLoginTest, LoginBlocksForUser) {
|
| PushResponse(net::HTTP_OK).set_content(GetRegisterResponse());
|
|
|
| case 3:
|
| - PushResponse(net::HTTP_OK).set_content(kOAuth2AccessTokenData);
|
| + if (!GetParam().use_webview)
|
| + PushResponse(net::HTTP_OK).set_content(kOAuth2AccessTokenData);
|
|
|
| case 2:
|
| - PushResponse(net::HTTP_OK).set_content(kOAuth2TokenPairData);
|
| + if (!GetParam().use_webview)
|
| + PushResponse(net::HTTP_OK).set_content(kOAuth2TokenPairData);
|
|
|
| case 1:
|
| PushResponse(net::HTTP_OK)
|
| @@ -319,24 +307,43 @@ IN_PROC_BROWSER_TEST_P(BlockingLoginTest, LoginBlocksForUser) {
|
| }
|
|
|
| const BlockingLoginTestParam kBlockinLoginTestCases[] = {
|
| - { 0, kUsername, true },
|
| - { 1, kUsername, true },
|
| - { 2, kUsername, true },
|
| - { 3, kUsername, true },
|
| - { 4, kUsername, true },
|
| - { 5, kUsername, true },
|
| - { 0, kUsername, false },
|
| - { 1, kUsername, false },
|
| - { 2, kUsername, false },
|
| - { 3, kUsername, false },
|
| - { 4, kUsername, false },
|
| - { 5, kUsername, false },
|
| - { 0, kUsernameOtherDomain, true },
|
| - { 1, kUsernameOtherDomain, true },
|
| - { 2, kUsernameOtherDomain, true },
|
| - { 3, kUsernameOtherDomain, true },
|
| - { 4, kUsernameOtherDomain, true },
|
| - { 5, kUsernameOtherDomain, true },
|
| + {0, kUsername, true, false},
|
| + {1, kUsername, true, false},
|
| + {2, kUsername, true, false},
|
| + {3, kUsername, true, false},
|
| + {4, kUsername, true, false},
|
| + {5, kUsername, true, false},
|
| + {0, kUsername, false, false},
|
| + {1, kUsername, false, false},
|
| + {2, kUsername, false, false},
|
| + {3, kUsername, false, false},
|
| + {4, kUsername, false, false},
|
| + {5, kUsername, false, false},
|
| + {0, kUsernameOtherDomain, true, false},
|
| + {1, kUsernameOtherDomain, true, false},
|
| + {2, kUsernameOtherDomain, true, false},
|
| + {3, kUsernameOtherDomain, true, false},
|
| + {4, kUsernameOtherDomain, true, false},
|
| + {5, kUsernameOtherDomain, true, false},
|
| +
|
| + {0, kUsername, true, true},
|
| + {1, kUsername, true, true},
|
| + {2, kUsername, true, true},
|
| + {3, kUsername, true, true},
|
| + {4, kUsername, true, true},
|
| + {5, kUsername, true, true},
|
| + {0, kUsername, false, true},
|
| + {1, kUsername, false, true},
|
| + {2, kUsername, false, true},
|
| + {3, kUsername, false, true},
|
| + {4, kUsername, false, true},
|
| + {5, kUsername, false, true},
|
| + {0, kUsernameOtherDomain, true, true},
|
| + {1, kUsernameOtherDomain, true, true},
|
| + {2, kUsernameOtherDomain, true, true},
|
| + {3, kUsernameOtherDomain, true, true},
|
| + {4, kUsernameOtherDomain, true, true},
|
| + {5, kUsernameOtherDomain, true, true},
|
| };
|
|
|
| INSTANTIATE_TEST_CASE_P(BlockingLoginTestInstance,
|
|
|