| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return response_.get() != NULL; | 80 return response_.get() != NULL; |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool GetResponse() { | 83 bool GetResponse() { |
| 84 EXPECT_TRUE(HasResponse()); | 84 EXPECT_TRUE(HasResponse()); |
| 85 return *response_.get(); | 85 return *response_.get(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 virtual void OnSendResponse(UIThreadExtensionFunction* function, | 88 virtual void OnSendResponse(UIThreadExtensionFunction* function, |
| 89 bool success, | 89 bool success, |
| 90 bool bad_message) OVERRIDE { | 90 bool bad_message) override { |
| 91 ASSERT_FALSE(bad_message); | 91 ASSERT_FALSE(bad_message); |
| 92 ASSERT_FALSE(HasResponse()); | 92 ASSERT_FALSE(HasResponse()); |
| 93 response_.reset(new bool); | 93 response_.reset(new bool); |
| 94 *response_ = success; | 94 *response_ = success; |
| 95 if (should_post_quit_) { | 95 if (should_post_quit_) { |
| 96 base::MessageLoopForUI::current()->Quit(); | 96 base::MessageLoopForUI::current()->Quit(); |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 private: | 100 private: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 scoped_ptr<SendResponseDelegate> response_delegate_; | 159 scoped_ptr<SendResponseDelegate> response_delegate_; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 class TestHangOAuth2MintTokenFlow : public OAuth2MintTokenFlow { | 162 class TestHangOAuth2MintTokenFlow : public OAuth2MintTokenFlow { |
| 163 public: | 163 public: |
| 164 TestHangOAuth2MintTokenFlow() | 164 TestHangOAuth2MintTokenFlow() |
| 165 : OAuth2MintTokenFlow(NULL, NULL, OAuth2MintTokenFlow::Parameters()) {} | 165 : OAuth2MintTokenFlow(NULL, NULL, OAuth2MintTokenFlow::Parameters()) {} |
| 166 | 166 |
| 167 virtual void Start() OVERRIDE { | 167 virtual void Start() override { |
| 168 // Do nothing, simulating a hanging network call. | 168 // Do nothing, simulating a hanging network call. |
| 169 } | 169 } |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 class TestOAuth2MintTokenFlow : public OAuth2MintTokenFlow { | 172 class TestOAuth2MintTokenFlow : public OAuth2MintTokenFlow { |
| 173 public: | 173 public: |
| 174 enum ResultType { | 174 enum ResultType { |
| 175 ISSUE_ADVICE_SUCCESS, | 175 ISSUE_ADVICE_SUCCESS, |
| 176 MINT_TOKEN_SUCCESS, | 176 MINT_TOKEN_SUCCESS, |
| 177 MINT_TOKEN_FAILURE, | 177 MINT_TOKEN_FAILURE, |
| 178 MINT_TOKEN_BAD_CREDENTIALS, | 178 MINT_TOKEN_BAD_CREDENTIALS, |
| 179 MINT_TOKEN_SERVICE_ERROR | 179 MINT_TOKEN_SERVICE_ERROR |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 TestOAuth2MintTokenFlow(ResultType result, | 182 TestOAuth2MintTokenFlow(ResultType result, |
| 183 OAuth2MintTokenFlow::Delegate* delegate) | 183 OAuth2MintTokenFlow::Delegate* delegate) |
| 184 : OAuth2MintTokenFlow(NULL, delegate, OAuth2MintTokenFlow::Parameters()), | 184 : OAuth2MintTokenFlow(NULL, delegate, OAuth2MintTokenFlow::Parameters()), |
| 185 result_(result), | 185 result_(result), |
| 186 delegate_(delegate) { | 186 delegate_(delegate) { |
| 187 } | 187 } |
| 188 | 188 |
| 189 virtual void Start() OVERRIDE { | 189 virtual void Start() override { |
| 190 switch (result_) { | 190 switch (result_) { |
| 191 case ISSUE_ADVICE_SUCCESS: { | 191 case ISSUE_ADVICE_SUCCESS: { |
| 192 IssueAdviceInfo info; | 192 IssueAdviceInfo info; |
| 193 delegate_->OnIssueAdviceSuccess(info); | 193 delegate_->OnIssueAdviceSuccess(info); |
| 194 break; | 194 break; |
| 195 } | 195 } |
| 196 case MINT_TOKEN_SUCCESS: { | 196 case MINT_TOKEN_SUCCESS: { |
| 197 delegate_->OnMintTokenSuccess(kAccessToken, 3600); | 197 delegate_->OnMintTokenSuccess(kAccessToken, 3600); |
| 198 break; | 198 break; |
| 199 } | 199 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 229 public: | 229 public: |
| 230 explicit WaitForGURLAndCloseWindow(GURL url) | 230 explicit WaitForGURLAndCloseWindow(GURL url) |
| 231 : WindowedNotificationObserver( | 231 : WindowedNotificationObserver( |
| 232 content::NOTIFICATION_LOAD_STOP, | 232 content::NOTIFICATION_LOAD_STOP, |
| 233 content::NotificationService::AllSources()), | 233 content::NotificationService::AllSources()), |
| 234 url_(url) {} | 234 url_(url) {} |
| 235 | 235 |
| 236 // NotificationObserver: | 236 // NotificationObserver: |
| 237 virtual void Observe(int type, | 237 virtual void Observe(int type, |
| 238 const content::NotificationSource& source, | 238 const content::NotificationSource& source, |
| 239 const content::NotificationDetails& details) OVERRIDE { | 239 const content::NotificationDetails& details) override { |
| 240 content::NavigationController* web_auth_flow_controller = | 240 content::NavigationController* web_auth_flow_controller = |
| 241 content::Source<content::NavigationController>(source).ptr(); | 241 content::Source<content::NavigationController>(source).ptr(); |
| 242 content::WebContents* web_contents = | 242 content::WebContents* web_contents = |
| 243 web_auth_flow_controller->GetWebContents(); | 243 web_auth_flow_controller->GetWebContents(); |
| 244 | 244 |
| 245 if (web_contents->GetURL() == url_) { | 245 if (web_contents->GetURL() == url_) { |
| 246 // It is safe to keep the pointer here, because we know in a test, that | 246 // It is safe to keep the pointer here, because we know in a test, that |
| 247 // the WebContents won't go away before CloseEmbedderWebContents is | 247 // the WebContents won't go away before CloseEmbedderWebContents is |
| 248 // called. Don't copy this code to production. | 248 // called. Don't copy this code to production. |
| 249 GuestViewBase* guest = GuestViewBase::FromWebContents(web_contents); | 249 GuestViewBase* guest = GuestViewBase::FromWebContents(web_contents); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 scope_ui_failure_ = GaiaWebAuthFlow::OAUTH_ERROR; | 309 scope_ui_failure_ = GaiaWebAuthFlow::OAUTH_ERROR; |
| 310 scope_ui_oauth_error_ = oauth_error; | 310 scope_ui_oauth_error_ = oauth_error; |
| 311 } | 311 } |
| 312 | 312 |
| 313 bool login_ui_shown() const { return login_ui_shown_; } | 313 bool login_ui_shown() const { return login_ui_shown_; } |
| 314 | 314 |
| 315 bool scope_ui_shown() const { return scope_ui_shown_; } | 315 bool scope_ui_shown() const { return scope_ui_shown_; } |
| 316 | 316 |
| 317 std::string login_access_token() const { return login_access_token_; } | 317 std::string login_access_token() const { return login_access_token_; } |
| 318 | 318 |
| 319 virtual void StartLoginAccessTokenRequest() OVERRIDE { | 319 virtual void StartLoginAccessTokenRequest() override { |
| 320 if (auto_login_access_token_) { | 320 if (auto_login_access_token_) { |
| 321 if (login_access_token_result_) { | 321 if (login_access_token_result_) { |
| 322 OnGetTokenSuccess(login_token_request_.get(), | 322 OnGetTokenSuccess(login_token_request_.get(), |
| 323 "access_token", | 323 "access_token", |
| 324 base::Time::Now() + base::TimeDelta::FromHours(1LL)); | 324 base::Time::Now() + base::TimeDelta::FromHours(1LL)); |
| 325 } else { | 325 } else { |
| 326 GoogleServiceAuthError error( | 326 GoogleServiceAuthError error( |
| 327 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); | 327 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); |
| 328 OnGetTokenFailure(login_token_request_.get(), error); | 328 OnGetTokenFailure(login_token_request_.get(), error); |
| 329 } | 329 } |
| 330 } else { | 330 } else { |
| 331 // Make a request to the token service. The test now must tell | 331 // Make a request to the token service. The test now must tell |
| 332 // the token service to issue an access token (or an error). | 332 // the token service to issue an access token (or an error). |
| 333 IdentityGetAuthTokenFunction::StartLoginAccessTokenRequest(); | 333 IdentityGetAuthTokenFunction::StartLoginAccessTokenRequest(); |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 | 336 |
| 337 virtual void ShowLoginPopup() OVERRIDE { | 337 virtual void ShowLoginPopup() override { |
| 338 EXPECT_FALSE(login_ui_shown_); | 338 EXPECT_FALSE(login_ui_shown_); |
| 339 login_ui_shown_ = true; | 339 login_ui_shown_ = true; |
| 340 if (login_ui_result_) | 340 if (login_ui_result_) |
| 341 SigninSuccess(); | 341 SigninSuccess(); |
| 342 else | 342 else |
| 343 SigninFailed(); | 343 SigninFailed(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 virtual void ShowOAuthApprovalDialog( | 346 virtual void ShowOAuthApprovalDialog( |
| 347 const IssueAdviceInfo& issue_advice) OVERRIDE { | 347 const IssueAdviceInfo& issue_advice) override { |
| 348 scope_ui_shown_ = true; | 348 scope_ui_shown_ = true; |
| 349 | 349 |
| 350 if (scope_ui_result_) { | 350 if (scope_ui_result_) { |
| 351 OnGaiaFlowCompleted(kAccessToken, "3600"); | 351 OnGaiaFlowCompleted(kAccessToken, "3600"); |
| 352 } else if (scope_ui_failure_ == GaiaWebAuthFlow::SERVICE_AUTH_ERROR) { | 352 } else if (scope_ui_failure_ == GaiaWebAuthFlow::SERVICE_AUTH_ERROR) { |
| 353 GoogleServiceAuthError error(GoogleServiceAuthError::CONNECTION_FAILED); | 353 GoogleServiceAuthError error(GoogleServiceAuthError::CONNECTION_FAILED); |
| 354 OnGaiaFlowFailure(scope_ui_failure_, error, ""); | 354 OnGaiaFlowFailure(scope_ui_failure_, error, ""); |
| 355 } else { | 355 } else { |
| 356 GoogleServiceAuthError error(GoogleServiceAuthError::NONE); | 356 GoogleServiceAuthError error(GoogleServiceAuthError::NONE); |
| 357 OnGaiaFlowFailure(scope_ui_failure_, error, scope_ui_oauth_error_); | 357 OnGaiaFlowFailure(scope_ui_failure_, error, scope_ui_oauth_error_); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 | 360 |
| 361 virtual OAuth2MintTokenFlow* CreateMintTokenFlow( | 361 virtual OAuth2MintTokenFlow* CreateMintTokenFlow( |
| 362 const std::string& login_access_token) OVERRIDE { | 362 const std::string& login_access_token) override { |
| 363 EXPECT_TRUE(login_access_token_.empty()); | 363 EXPECT_TRUE(login_access_token_.empty()); |
| 364 // Save the login token used to create the flow so tests can see | 364 // Save the login token used to create the flow so tests can see |
| 365 // what account was used. | 365 // what account was used. |
| 366 login_access_token_ = login_access_token; | 366 login_access_token_ = login_access_token; |
| 367 return flow_.release(); | 367 return flow_.release(); |
| 368 } | 368 } |
| 369 | 369 |
| 370 private: | 370 private: |
| 371 virtual ~FakeGetAuthTokenFunction() {} | 371 virtual ~FakeGetAuthTokenFunction() {} |
| 372 bool login_access_token_result_; | 372 bool login_access_token_result_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 390 | 390 |
| 391 gaia::AccountIds CreateIds(std::string email, std::string obfid) { | 391 gaia::AccountIds CreateIds(std::string email, std::string obfid) { |
| 392 gaia::AccountIds ids; | 392 gaia::AccountIds ids; |
| 393 ids.account_key = email; | 393 ids.account_key = email; |
| 394 ids.email = email; | 394 ids.email = email; |
| 395 ids.gaia = obfid; | 395 ids.gaia = obfid; |
| 396 return ids; | 396 return ids; |
| 397 } | 397 } |
| 398 | 398 |
| 399 class IdentityGetAccountsFunctionTest : public ExtensionBrowserTest { | 399 class IdentityGetAccountsFunctionTest : public ExtensionBrowserTest { |
| 400 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 400 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 401 ExtensionBrowserTest::SetUpCommandLine(command_line); | 401 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 402 command_line->AppendSwitch(switches::kExtensionsMultiAccount); | 402 command_line->AppendSwitch(switches::kExtensionsMultiAccount); |
| 403 } | 403 } |
| 404 | 404 |
| 405 protected: | 405 protected: |
| 406 void SetAccountState(gaia::AccountIds ids, bool is_signed_in) { | 406 void SetAccountState(gaia::AccountIds ids, bool is_signed_in) { |
| 407 IdentityAPI::GetFactoryInstance()->Get(profile())->SetAccountStateForTest( | 407 IdentityAPI::GetFactoryInstance()->Get(profile())->SetAccountStateForTest( |
| 408 ids, is_signed_in); | 408 ids, is_signed_in); |
| 409 } | 409 } |
| 410 | 410 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 SetAccountState(CreateIds("primary@example.com", "1"), true); | 502 SetAccountState(CreateIds("primary@example.com", "1"), true); |
| 503 SetAccountState(CreateIds("secondary@example.com", "2"), true); | 503 SetAccountState(CreateIds("secondary@example.com", "2"), true); |
| 504 std::vector<std::string> two_accounts; | 504 std::vector<std::string> two_accounts; |
| 505 two_accounts.push_back("1"); | 505 two_accounts.push_back("1"); |
| 506 two_accounts.push_back("2"); | 506 two_accounts.push_back("2"); |
| 507 EXPECT_TRUE(ExpectGetAccounts(two_accounts)); | 507 EXPECT_TRUE(ExpectGetAccounts(two_accounts)); |
| 508 } | 508 } |
| 509 | 509 |
| 510 class IdentityOldProfilesGetAccountsFunctionTest | 510 class IdentityOldProfilesGetAccountsFunctionTest |
| 511 : public IdentityGetAccountsFunctionTest { | 511 : public IdentityGetAccountsFunctionTest { |
| 512 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 512 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 513 // Don't add the multi-account switch that parent class would have. | 513 // Don't add the multi-account switch that parent class would have. |
| 514 } | 514 } |
| 515 }; | 515 }; |
| 516 | 516 |
| 517 IN_PROC_BROWSER_TEST_F(IdentityOldProfilesGetAccountsFunctionTest, | 517 IN_PROC_BROWSER_TEST_F(IdentityOldProfilesGetAccountsFunctionTest, |
| 518 MultiAccountOff) { | 518 MultiAccountOff) { |
| 519 EXPECT_FALSE(switches::IsExtensionsMultiAccount()); | 519 EXPECT_FALSE(switches::IsExtensionsMultiAccount()); |
| 520 } | 520 } |
| 521 | 521 |
| 522 IN_PROC_BROWSER_TEST_F(IdentityOldProfilesGetAccountsFunctionTest, | 522 IN_PROC_BROWSER_TEST_F(IdentityOldProfilesGetAccountsFunctionTest, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUserAccountId, | 591 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUserAccountId, |
| 592 "12345"); | 592 "12345"); |
| 593 | 593 |
| 594 scoped_ptr<api::identity::ProfileUserInfo> info = RunGetProfileUserInfo(); | 594 scoped_ptr<api::identity::ProfileUserInfo> info = RunGetProfileUserInfo(); |
| 595 EXPECT_TRUE(info->email.empty()); | 595 EXPECT_TRUE(info->email.empty()); |
| 596 EXPECT_EQ("12345", info->id); | 596 EXPECT_EQ("12345", info->id); |
| 597 } | 597 } |
| 598 | 598 |
| 599 class GetAuthTokenFunctionTest : public AsyncExtensionBrowserTest { | 599 class GetAuthTokenFunctionTest : public AsyncExtensionBrowserTest { |
| 600 public: | 600 public: |
| 601 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 601 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 602 AsyncExtensionBrowserTest::SetUpCommandLine(command_line); | 602 AsyncExtensionBrowserTest::SetUpCommandLine(command_line); |
| 603 command_line->AppendSwitch(switches::kExtensionsMultiAccount); | 603 command_line->AppendSwitch(switches::kExtensionsMultiAccount); |
| 604 } | 604 } |
| 605 | 605 |
| 606 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 606 virtual void SetUpInProcessBrowserTestFixture() override { |
| 607 AsyncExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); | 607 AsyncExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 608 | 608 |
| 609 will_create_browser_context_services_subscription_ = | 609 will_create_browser_context_services_subscription_ = |
| 610 BrowserContextDependencyManager::GetInstance() | 610 BrowserContextDependencyManager::GetInstance() |
| 611 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( | 611 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( |
| 612 base::Bind(&GetAuthTokenFunctionTest:: | 612 base::Bind(&GetAuthTokenFunctionTest:: |
| 613 OnWillCreateBrowserContextServices, | 613 OnWillCreateBrowserContextServices, |
| 614 base::Unretained(this))) | 614 base::Unretained(this))) |
| 615 .Pass(); | 615 .Pass(); |
| 616 } | 616 } |
| 617 | 617 |
| 618 void OnWillCreateBrowserContextServices(content::BrowserContext* context) { | 618 void OnWillCreateBrowserContextServices(content::BrowserContext* context) { |
| 619 // Replace the signin manager and token service with fakes. Do this ahead of | 619 // Replace the signin manager and token service with fakes. Do this ahead of |
| 620 // creating the browser so that a bunch of classes don't register as | 620 // creating the browser so that a bunch of classes don't register as |
| 621 // observers and end up needing to unregister when the fake is substituted. | 621 // observers and end up needing to unregister when the fake is substituted. |
| 622 SigninManagerFactory::GetInstance()->SetTestingFactory( | 622 SigninManagerFactory::GetInstance()->SetTestingFactory( |
| 623 context, &FakeSigninManagerBase::Build); | 623 context, &FakeSigninManagerBase::Build); |
| 624 ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory( | 624 ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory( |
| 625 context, &BuildFakeProfileOAuth2TokenService); | 625 context, &BuildFakeProfileOAuth2TokenService); |
| 626 AccountReconcilorFactory::GetInstance()->SetTestingFactory( | 626 AccountReconcilorFactory::GetInstance()->SetTestingFactory( |
| 627 context, &FakeAccountReconcilor::Build); | 627 context, &FakeAccountReconcilor::Build); |
| 628 } | 628 } |
| 629 | 629 |
| 630 virtual void SetUpOnMainThread() OVERRIDE { | 630 virtual void SetUpOnMainThread() override { |
| 631 AsyncExtensionBrowserTest::SetUpOnMainThread(); | 631 AsyncExtensionBrowserTest::SetUpOnMainThread(); |
| 632 | 632 |
| 633 // Grab references to the fake signin manager and token service. | 633 // Grab references to the fake signin manager and token service. |
| 634 signin_manager_ = static_cast<FakeSigninManagerForTesting*>( | 634 signin_manager_ = static_cast<FakeSigninManagerForTesting*>( |
| 635 SigninManagerFactory::GetInstance()->GetForProfile(profile())); | 635 SigninManagerFactory::GetInstance()->GetForProfile(profile())); |
| 636 ASSERT_TRUE(signin_manager_); | 636 ASSERT_TRUE(signin_manager_); |
| 637 token_service_ = static_cast<FakeProfileOAuth2TokenService*>( | 637 token_service_ = static_cast<FakeProfileOAuth2TokenService*>( |
| 638 ProfileOAuth2TokenServiceFactory::GetInstance()->GetForProfile( | 638 ProfileOAuth2TokenServiceFactory::GetInstance()->GetForProfile( |
| 639 profile())); | 639 profile())); |
| 640 ASSERT_TRUE(token_service_); | 640 ASSERT_TRUE(token_service_); |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 SetCachedToken(token); | 1650 SetCachedToken(token); |
| 1651 EXPECT_EQ(IdentityTokenCacheValue::CACHE_STATUS_TOKEN, | 1651 EXPECT_EQ(IdentityTokenCacheValue::CACHE_STATUS_TOKEN, |
| 1652 GetCachedToken().status()); | 1652 GetCachedToken().status()); |
| 1653 EXPECT_TRUE(InvalidateDefaultToken()); | 1653 EXPECT_TRUE(InvalidateDefaultToken()); |
| 1654 EXPECT_EQ(IdentityTokenCacheValue::CACHE_STATUS_NOTFOUND, | 1654 EXPECT_EQ(IdentityTokenCacheValue::CACHE_STATUS_NOTFOUND, |
| 1655 GetCachedToken().status()); | 1655 GetCachedToken().status()); |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 class LaunchWebAuthFlowFunctionTest : public AsyncExtensionBrowserTest { | 1658 class LaunchWebAuthFlowFunctionTest : public AsyncExtensionBrowserTest { |
| 1659 public: | 1659 public: |
| 1660 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 1660 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 1661 AsyncExtensionBrowserTest::SetUpCommandLine(command_line); | 1661 AsyncExtensionBrowserTest::SetUpCommandLine(command_line); |
| 1662 // Reduce performance test variance by disabling background networking. | 1662 // Reduce performance test variance by disabling background networking. |
| 1663 command_line->AppendSwitch(switches::kDisableBackgroundNetworking); | 1663 command_line->AppendSwitch(switches::kDisableBackgroundNetworking); |
| 1664 } | 1664 } |
| 1665 }; | 1665 }; |
| 1666 | 1666 |
| 1667 IN_PROC_BROWSER_TEST_F(LaunchWebAuthFlowFunctionTest, UserCloseWindow) { | 1667 IN_PROC_BROWSER_TEST_F(LaunchWebAuthFlowFunctionTest, UserCloseWindow) { |
| 1668 net::SpawnedTestServer https_server( | 1668 net::SpawnedTestServer https_server( |
| 1669 net::SpawnedTestServer::TYPE_HTTPS, | 1669 net::SpawnedTestServer::TYPE_HTTPS, |
| 1670 net::SpawnedTestServer::kLocalhost, | 1670 net::SpawnedTestServer::kLocalhost, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1811 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), | 1811 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), |
| 1812 url); | 1812 url); |
| 1813 } | 1813 } |
| 1814 | 1814 |
| 1815 } // namespace extensions | 1815 } // namespace extensions |
| 1816 | 1816 |
| 1817 // Tests the chrome.identity API implemented by custom JS bindings . | 1817 // Tests the chrome.identity API implemented by custom JS bindings . |
| 1818 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { | 1818 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { |
| 1819 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; | 1819 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; |
| 1820 } | 1820 } |
| OLD | NEW |