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 "chrome/browser/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 if (steps < 5) { | 676 if (steps < 5) { |
677 // Verify that the profile hasn't been created yet. | 677 // Verify that the profile hasn't been created yet. |
678 EXPECT_FALSE(prepared_profile_); | 678 EXPECT_FALSE(prepared_profile_); |
679 | 679 |
680 // Make the current fetcher fail with a Gaia error. | 680 // Make the current fetcher fail with a Gaia error. |
681 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID( | 681 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID( |
682 next_expected_fetcher_id); | 682 next_expected_fetcher_id); |
683 ASSERT_TRUE(fetcher); | 683 ASSERT_TRUE(fetcher); |
684 EXPECT_TRUE(fetcher->delegate()); | 684 EXPECT_TRUE(fetcher->delegate()); |
685 fetcher->set_url(fetcher->GetOriginalURL()); | 685 fetcher->set_url(fetcher->GetOriginalURL()); |
686 fetcher->set_response_code(403); | 686 fetcher->set_response_code(401); |
687 // This response body is important to make the gaia fetcher skip its delayed | 687 // This response body is important to make the gaia fetcher skip its delayed |
688 // retry behavior, which makes testing harder. If this is sent to the policy | 688 // retry behavior, which makes testing harder. If this is sent to the policy |
689 // fetchers then it will make them fail too. | 689 // fetchers then it will make them fail too. |
690 fetcher->SetResponseString(kGaiaAccountDisabledResponse); | 690 fetcher->SetResponseString(kGaiaAccountDisabledResponse); |
691 fetcher->delegate()->OnURLFetchComplete(fetcher); | 691 fetcher->delegate()->OnURLFetchComplete(fetcher); |
692 RunUntilIdle(); | 692 RunUntilIdle(); |
693 } | 693 } |
694 | 694 |
695 // The profile is finally ready: | 695 // The profile is finally ready: |
696 EXPECT_TRUE(prepared_profile_); | 696 EXPECT_TRUE(prepared_profile_); |
697 } | 697 } |
698 | 698 |
699 INSTANTIATE_TEST_CASE_P( | 699 INSTANTIATE_TEST_CASE_P( |
700 LoginUtilsBlockingLoginTestInstance, | 700 LoginUtilsBlockingLoginTestInstance, |
701 LoginUtilsBlockingLoginTest, | 701 LoginUtilsBlockingLoginTest, |
702 testing::Values(0, 1, 2, 3, 4, 5)); | 702 testing::Values(0, 1, 2, 3, 4, 5)); |
703 | 703 |
704 } // namespace | 704 } // namespace |
705 | 705 |
706 } | 706 } |
OLD | NEW |