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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager_unittest.cc

Issue 2554743003: arc: Fix double provisioning failure reporting. (Closed)
Patch Set: rebase / todo added Created 4 years 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
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698