Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/chromeos/policy/blocking_login_browsertest.cc

Issue 1727413002: Reland: No longer start up profile if there was an error fetching policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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).
84 class BlockingLoginTest 89 class BlockingLoginTest
85 : public OobeBaseTest, 90 : public OobeBaseTest,
86 public content::NotificationObserver, 91 public content::NotificationObserver,
87 public testing::WithParamInterface<BlockingLoginTestParam> { 92 public testing::WithParamInterface<BlockingLoginTestParam> {
88 public: 93 public:
89 BlockingLoginTest() : profile_added_(NULL) { 94 BlockingLoginTest() : profile_added_(NULL) {
90 } 95 }
91 96
92 void SetUpCommandLine(base::CommandLine* command_line) override { 97 void SetUpCommandLine(base::CommandLine* command_line) override {
93 OobeBaseTest::SetUpCommandLine(command_line); 98 OobeBaseTest::SetUpCommandLine(command_line);
94 99
95 command_line->AppendSwitchASCII( 100 command_line->AppendSwitchASCII(
96 policy::switches::kDeviceManagementUrl, 101 policy::switches::kDeviceManagementUrl,
97 embedded_test_server()->GetURL("/device_management").spec()); 102 embedded_test_server()->GetURL("/device_management").spec());
103
104 command_line->AppendSwitch(
105 chromeos::switches::kAllowFailedPolicyFetchForTest);
98 } 106 }
99 107
100 void SetUpOnMainThread() override { 108 void SetUpOnMainThread() override {
101 registrar_.Add(this, 109 registrar_.Add(this,
102 chrome::NOTIFICATION_PROFILE_ADDED, 110 chrome::NOTIFICATION_PROFILE_ADDED,
103 content::NotificationService::AllSources()); 111 content::NotificationService::AllSources());
104 112
105 OobeBaseTest::SetUpOnMainThread(); 113 OobeBaseTest::SetUpOnMainThread();
106 } 114 }
107 115
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 {3, kUsernameOtherDomain, true}, 328 {3, kUsernameOtherDomain, true},
321 {4, kUsernameOtherDomain, true}, 329 {4, kUsernameOtherDomain, true},
322 {5, kUsernameOtherDomain, true}, 330 {5, kUsernameOtherDomain, true},
323 }; 331 };
324 332
325 INSTANTIATE_TEST_CASE_P(BlockingLoginTestInstance, 333 INSTANTIATE_TEST_CASE_P(BlockingLoginTestInstance,
326 BlockingLoginTest, 334 BlockingLoginTest,
327 testing::ValuesIn(kBlockinLoginTestCases)); 335 testing::ValuesIn(kBlockinLoginTestCases));
328 336
329 } // namespace chromeos 337 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/policy/affiliation_test_helper.cc ('k') | chrome/browser/chromeos/policy/login_policy_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698