| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace | 76 } // namespace |
| 77 | 77 |
| 78 struct BlockingLoginTestParam { | 78 struct BlockingLoginTestParam { |
| 79 const int steps; | 79 const int steps; |
| 80 const char* username; | 80 const char* username; |
| 81 const bool enroll_device; | 81 const bool enroll_device; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 // TODO(atwilson): This test is completely broken - it originally was built | |
| 85 // when we made an entirely different set of network calls on startup. As a | |
| 86 // result it generates random failures in startup network requests, then waits | |
| 87 // to see if the profile finishes loading which is not at all what it is | |
| 88 // intended to test. We need to fix this test or remove it (crbug.com/580537). | |
| 89 class BlockingLoginTest | 84 class BlockingLoginTest |
| 90 : public OobeBaseTest, | 85 : public OobeBaseTest, |
| 91 public content::NotificationObserver, | 86 public content::NotificationObserver, |
| 92 public testing::WithParamInterface<BlockingLoginTestParam> { | 87 public testing::WithParamInterface<BlockingLoginTestParam> { |
| 93 public: | 88 public: |
| 94 BlockingLoginTest() : profile_added_(NULL) { | 89 BlockingLoginTest() : profile_added_(NULL) { |
| 95 } | 90 } |
| 96 | 91 |
| 97 void SetUpCommandLine(base::CommandLine* command_line) override { | 92 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 98 OobeBaseTest::SetUpCommandLine(command_line); | 93 OobeBaseTest::SetUpCommandLine(command_line); |
| 99 | 94 |
| 100 command_line->AppendSwitchASCII( | 95 command_line->AppendSwitchASCII( |
| 101 policy::switches::kDeviceManagementUrl, | 96 policy::switches::kDeviceManagementUrl, |
| 102 embedded_test_server()->GetURL("/device_management").spec()); | 97 embedded_test_server()->GetURL("/device_management").spec()); |
| 103 | |
| 104 command_line->AppendSwitch( | |
| 105 chromeos::switches::kAllowFailedPolicyFetchForTest); | |
| 106 } | 98 } |
| 107 | 99 |
| 108 void SetUpOnMainThread() override { | 100 void SetUpOnMainThread() override { |
| 109 registrar_.Add(this, | 101 registrar_.Add(this, |
| 110 chrome::NOTIFICATION_PROFILE_ADDED, | 102 chrome::NOTIFICATION_PROFILE_ADDED, |
| 111 content::NotificationService::AllSources()); | 103 content::NotificationService::AllSources()); |
| 112 | 104 |
| 113 OobeBaseTest::SetUpOnMainThread(); | 105 OobeBaseTest::SetUpOnMainThread(); |
| 114 } | 106 } |
| 115 | 107 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 {3, kUsernameOtherDomain, true}, | 320 {3, kUsernameOtherDomain, true}, |
| 329 {4, kUsernameOtherDomain, true}, | 321 {4, kUsernameOtherDomain, true}, |
| 330 {5, kUsernameOtherDomain, true}, | 322 {5, kUsernameOtherDomain, true}, |
| 331 }; | 323 }; |
| 332 | 324 |
| 333 INSTANTIATE_TEST_CASE_P(BlockingLoginTestInstance, | 325 INSTANTIATE_TEST_CASE_P(BlockingLoginTestInstance, |
| 334 BlockingLoginTest, | 326 BlockingLoginTest, |
| 335 testing::ValuesIn(kBlockinLoginTestCases)); | 327 testing::ValuesIn(kBlockinLoginTestCases)); |
| 336 | 328 |
| 337 } // namespace chromeos | 329 } // namespace chromeos |
| OLD | NEW |