| 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 <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 TabStripModel* tabs = browser->tab_strip_model(); | 96 TabStripModel* tabs = browser->tab_strip_model(); |
| 97 ASSERT_TRUE(tabs); | 97 ASSERT_TRUE(tabs); |
| 98 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); | 98 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); |
| 99 EXPECT_EQ(expected_tab_count, tabs->count()); | 99 EXPECT_EQ(expected_tab_count, tabs->count()); |
| 100 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { | 100 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { |
| 101 EXPECT_EQ(GURL(kStartupURLs[i]), | 101 EXPECT_EQ(GURL(kStartupURLs[i]), |
| 102 tabs->GetWebContentsAt(i)->GetVisibleURL()); | 102 tabs->GetWebContentsAt(i)->GetVisibleURL()); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 IN_PROC_BROWSER_TEST_F(UserCloudPolicyManagerTest, ErrorLoadingPolicy) { | 106 // Test disabled. See crbug.com/600617. |
| 107 IN_PROC_BROWSER_TEST_F(UserCloudPolicyManagerTest, |
| 108 DISABLED_ErrorLoadingPolicy) { |
| 107 // Delete the policy file - this will cause a 500 error on policy requests. | 109 // Delete the policy file - this will cause a 500 error on policy requests. |
| 108 user_policy_helper()->DeletePolicyFile(); | 110 user_policy_helper()->DeletePolicyFile(); |
| 109 SkipToLoginScreen(); | 111 SkipToLoginScreen(); |
| 110 CountNotificationObserver observer( | 112 CountNotificationObserver observer( |
| 111 chrome::NOTIFICATION_SESSION_STARTED, | 113 chrome::NOTIFICATION_SESSION_STARTED, |
| 112 content::NotificationService::AllSources()); | 114 content::NotificationService::AllSources()); |
| 113 GetLoginDisplay()->ShowSigninScreenForCreds(kAccountId, kAccountPassword); | 115 GetLoginDisplay()->ShowSigninScreenForCreds(kAccountId, kAccountPassword); |
| 114 base::RunLoop().Run(); | 116 base::RunLoop().Run(); |
| 115 // Should not receive a SESSION_STARTED notification. | 117 // Should not receive a SESSION_STARTED notification. |
| 116 ASSERT_EQ(0, observer.notification_count()); | 118 ASSERT_EQ(0, observer.notification_count()); |
| 117 | 119 |
| 118 // User should not be marked as having a valid OAuth token. That way, if we | 120 // User should not be marked as having a valid OAuth token. That way, if we |
| 119 // try to load the user in the future, we will attempt to load policy again. | 121 // try to load the user in the future, we will attempt to load policy again. |
| 120 const user_manager::UserManager* user_manager = | 122 const user_manager::UserManager* user_manager = |
| 121 user_manager::UserManager::Get(); | 123 user_manager::UserManager::Get(); |
| 122 EXPECT_NE(user_manager::User::OAUTH2_TOKEN_STATUS_VALID, | 124 EXPECT_NE(user_manager::User::OAUTH2_TOKEN_STATUS_VALID, |
| 123 user_manager->GetActiveUser()->oauth_token_status()); | 125 user_manager->GetActiveUser()->oauth_token_status()); |
| 124 } | 126 } |
| 125 | 127 |
| 126 } // namespace policy | 128 } // namespace policy |
| OLD | NEW |