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

Unified Diff: chrome/browser/signin/signin_tracker_unittest.cc

Issue 180743018: Move SigninTracker away from listening for SigninManager notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move include of SigninManagerFactory Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/signin_tracker_unittest.cc
diff --git a/chrome/browser/signin/signin_tracker_unittest.cc b/chrome/browser/signin/signin_tracker_unittest.cc
index bce064ef49be5cd2833d9cb8537707fe972e9155..3f01a10b4ded89628cd031dad1e3964cee32eaea 100644
--- a/chrome/browser/signin/signin_tracker_unittest.cc
+++ b/chrome/browser/signin/signin_tracker_unittest.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_service_mock.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/browser/notification_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/google_service_auth_error.h"
@@ -81,18 +80,18 @@ class SigninTrackerTest : public testing::Test {
MockObserver observer_;
};
+#if !defined(OS_CHROMEOS)
TEST_F(SigninTrackerTest, SignInFails) {
- // SIGNIN_FAILED notification should result in a SigninFailed callback.
const GoogleServiceAuthError error(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
+
+ // Signin failure should result in a SigninFailed callback.
EXPECT_CALL(observer_, SigninSuccess()).Times(0);
EXPECT_CALL(observer_, SigninFailed(error));
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED,
- content::Source<Profile>(profile_.get()),
- content::Details<const GoogleServiceAuthError>(&error));
+ mock_signin_manager_->FailSignin(error);
}
+#endif // !defined(OS_CHROMEOS)
TEST_F(SigninTrackerTest, SignInSucceeds) {
EXPECT_CALL(observer_, SigninSuccess());
« no previous file with comments | « chrome/browser/signin/signin_tracker.cc ('k') | chrome/browser/ui/bookmarks/bookmark_prompt_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698