| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); | 445 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); |
| 446 | 446 |
| 447 ASSERT_TRUE( | 447 ASSERT_TRUE( |
| 448 WaitForDataRemoved(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE)); | 448 WaitForDataRemoved(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE)); |
| 449 | 449 |
| 450 EXPECT_FALSE( | 450 EXPECT_FALSE( |
| 451 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); | 451 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); |
| 452 | 452 |
| 453 arc_session_manager()->StartArc(); | 453 arc_session_manager()->StartArc(); |
| 454 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); | 454 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); |
| 455 |
| 455 arc_session_manager()->Shutdown(); | 456 arc_session_manager()->Shutdown(); |
| 456 } | 457 } |
| 457 | 458 |
| 459 TEST_F(ArcSessionManagerTest, IgnoreSecondErrorReporting) { |
| 460 profile()->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); |
| 461 arc_session_manager()->OnPrimaryUserProfilePrepared(profile()); |
| 462 arc_session_manager()->StartArc(); |
| 463 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); |
| 464 |
| 465 // Report some failure that does not stop the bridge. |
| 466 arc_session_manager()->OnProvisioningFinished( |
| 467 ProvisioningResult::GMS_SIGN_IN_FAILED); |
| 468 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); |
| 469 |
| 470 // Try to send another error that stops the bridge if sent first. It should |
| 471 // be ignored. |
| 472 arc_session_manager()->OnProvisioningFinished( |
| 473 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR); |
| 474 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); |
| 475 |
| 476 arc_session_manager()->Shutdown(); |
| 477 } |
| 478 |
| 458 } // namespace arc | 479 } // namespace arc |
| OLD | NEW |