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

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

Issue 2554743003: arc: Fix double provisioning failure reporting. (Closed)
Patch Set: add unit test and comments addressed 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
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 GetFakeUserManager()->SwitchActiveUser(account_id); 370 GetFakeUserManager()->SwitchActiveUser(account_id);
371 second_profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); 371 second_profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true);
372 372
373 // Check that non-primary user can't use Arc. 373 // Check that non-primary user can't use Arc.
374 EXPECT_FALSE(chromeos::ProfileHelper::IsPrimaryProfile(second_profile.get())); 374 EXPECT_FALSE(chromeos::ProfileHelper::IsPrimaryProfile(second_profile.get()));
375 EXPECT_FALSE(ArcAppListPrefs::Get(second_profile.get())); 375 EXPECT_FALSE(ArcAppListPrefs::Get(second_profile.get()));
376 376
377 arc_session_manager()->Shutdown(); 377 arc_session_manager()->Shutdown();
378 } 378 }
379 379
380 TEST_F(ArcSessionManagerTest, IgnoreSecondErrorReporting) {
381 profile()->GetPrefs()->SetBoolean(prefs::kArcEnabled, true);
382 arc_session_manager()->OnPrimaryUserProfilePrepared(profile());
383 arc_session_manager()->StartArc();
384 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
385
386 // Report some failure that does not stop the bridge.
387 arc_session_manager()->OnProvisioningFinished(
388 ProvisioningResult::GMS_SIGN_IN_FAILED);
389 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
390
391 // Try to send another error that stops the bridge if sent first. It should
392 // be ignored.
393 arc_session_manager()->OnProvisioningFinished(
394 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
395 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
396
397 arc_session_manager()->Shutdown();
398 }
399
380 } // namespace arc 400 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698