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

Unified Diff: chrome/browser/sync/sync_ui_util_unittest.cc

Issue 11886079: Revert 177136 due to memory error on Mac ASAN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « chrome/browser/sync/sync_ui_util.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_ui_util_unittest.cc
===================================================================
--- chrome/browser/sync/sync_ui_util_unittest.cc (revision 177205)
+++ chrome/browser/sync/sync_ui_util_unittest.cc (working copy)
@@ -92,7 +92,7 @@
}
// Test that GetStatusLabelsForSyncGlobalError returns an error if a
-// passphrase is required and not for auth errors.
+// passphrase is required.
TEST(SyncUIUtilTest, AuthAndPassphraseGlobalError) {
MessageLoopForUI message_loop;
content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
@@ -117,14 +117,14 @@
string16 menu_label, label2, label3;
sync_ui_util::GetStatusLabelsForSyncGlobalError(
&service, signin, &menu_label, &label2, &label3);
- // Make sure we are still displaying the passphrase error badge (don't show
- // auth errors through SyncUIUtil).
- EXPECT_EQ(menu_label, l10n_util::GetStringUTF16(
+ // Make sure we aren't displaying the passphrase error badge.
+ EXPECT_NE(menu_label, l10n_util::GetStringUTF16(
IDS_SYNC_PASSPHRASE_ERROR_WRENCH_MENU_ITEM));
}
-// Test that GetStatusLabelsForSyncGlobalError does not indicate errors for
-// auth errors (these are reported through SigninGlobalError).
+// Test that GetStatusLabelsForSyncGlobalError indicates errors for conditions
+// that can be resolved by the user and suppresses errors for conditions that
+// cannot be resolved by the user.
TEST(SyncUIUtilTest, AuthStateGlobalError) {
MessageLoopForUI message_loop;
content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
@@ -136,24 +136,29 @@
EXPECT_CALL(service, QueryDetailedSyncStatus(_))
.WillRepeatedly(Return(false));
- GoogleServiceAuthError::State table[] = {
- GoogleServiceAuthError::NONE,
- GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS,
- GoogleServiceAuthError::USER_NOT_SIGNED_UP,
- GoogleServiceAuthError::CONNECTION_FAILED,
- GoogleServiceAuthError::CAPTCHA_REQUIRED,
- GoogleServiceAuthError::ACCOUNT_DELETED,
- GoogleServiceAuthError::ACCOUNT_DISABLED,
- GoogleServiceAuthError::SERVICE_UNAVAILABLE,
- GoogleServiceAuthError::TWO_FACTOR,
- GoogleServiceAuthError::REQUEST_CANCELED,
- GoogleServiceAuthError::HOSTED_NOT_ALLOWED
+ struct {
+ GoogleServiceAuthError::State error_state;
+ bool is_error;
+ } table[] = {
+ { GoogleServiceAuthError::NONE, false },
+ { GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, true },
+ { GoogleServiceAuthError::USER_NOT_SIGNED_UP, true },
+ { GoogleServiceAuthError::CONNECTION_FAILED, false },
+ { GoogleServiceAuthError::CAPTCHA_REQUIRED, true },
+ { GoogleServiceAuthError::ACCOUNT_DELETED, true },
+ { GoogleServiceAuthError::ACCOUNT_DISABLED, true },
+ { GoogleServiceAuthError::SERVICE_UNAVAILABLE, true },
+ { GoogleServiceAuthError::TWO_FACTOR, true },
+ { GoogleServiceAuthError::REQUEST_CANCELED, true },
+ { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true },
};
FakeSigninManager signin(profile.get());
- for (size_t i = 0; i < arraysize(table); ++i) {
- VerifySyncGlobalErrorResult(&service, signin, table[i], true, false);
- VerifySyncGlobalErrorResult(&service, signin, table[i], false, false);
+ for (size_t i = 0; i < sizeof(table)/sizeof(*table); ++i) {
+ VerifySyncGlobalErrorResult(
+ &service, signin, table[i].error_state, true, table[i].is_error);
+ VerifySyncGlobalErrorResult(
+ &service, signin, table[i].error_state, false, false);
}
}
// Loads a ProfileSyncServiceMock to emulate one of a number of distinct cases
Property changes on: chrome/browser/sync/sync_ui_util_unittest.cc
___________________________________________________________________
Deleted: svn:mergeinfo
« no previous file with comments | « chrome/browser/sync/sync_ui_util.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698