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

Side by Side Diff: chrome/browser/signin/signin_global_error_unittest.cc

Issue 655413002: Convert ARRAYSIZE_UNSAFE -> arraysize in chrome/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/signin/signin_global_error.h" 5 #include "chrome/browser/signin/signin_global_error.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 9 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
10 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" 10 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 { GoogleServiceAuthError::ACCOUNT_DELETED, true }, 105 { GoogleServiceAuthError::ACCOUNT_DELETED, true },
106 { GoogleServiceAuthError::ACCOUNT_DISABLED, true }, 106 { GoogleServiceAuthError::ACCOUNT_DISABLED, true },
107 { GoogleServiceAuthError::SERVICE_UNAVAILABLE, true }, 107 { GoogleServiceAuthError::SERVICE_UNAVAILABLE, true },
108 { GoogleServiceAuthError::TWO_FACTOR, true }, 108 { GoogleServiceAuthError::TWO_FACTOR, true },
109 { GoogleServiceAuthError::REQUEST_CANCELED, true }, 109 { GoogleServiceAuthError::REQUEST_CANCELED, true },
110 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true }, 110 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true },
111 { GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, true }, 111 { GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, true },
112 { GoogleServiceAuthError::SERVICE_ERROR, true }, 112 { GoogleServiceAuthError::SERVICE_ERROR, true },
113 { GoogleServiceAuthError::WEB_LOGIN_REQUIRED, true }, 113 { GoogleServiceAuthError::WEB_LOGIN_REQUIRED, true },
114 }; 114 };
115 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(table) == GoogleServiceAuthError::NUM_STATES, 115 COMPILE_ASSERT(arraysize(table) == GoogleServiceAuthError::NUM_STATES,
116 kTable_size_does_not_match_number_of_auth_error_types); 116 kTable_size_does_not_match_number_of_auth_error_types);
117 117
118 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(table); ++i) { 118 for (size_t i = 0; i < arraysize(table); ++i) {
119 FakeAuthStatusProvider provider(error_controller_); 119 FakeAuthStatusProvider provider(error_controller_);
120 provider.SetAuthError(kTestAccountId, 120 provider.SetAuthError(kTestAccountId,
121 kTestUsername, 121 kTestUsername,
122 GoogleServiceAuthError(table[i].error_state)); 122 GoogleServiceAuthError(table[i].error_state));
123 123
124 EXPECT_EQ(global_error_->HasMenuItem(), table[i].is_error); 124 EXPECT_EQ(global_error_->HasMenuItem(), table[i].is_error);
125 EXPECT_EQ(global_error_->MenuItemLabel().empty(), !table[i].is_error); 125 EXPECT_EQ(global_error_->MenuItemLabel().empty(), !table[i].is_error);
126 EXPECT_EQ(global_error_->GetBubbleViewMessages().empty(), 126 EXPECT_EQ(global_error_->GetBubbleViewMessages().empty(),
127 !table[i].is_error); 127 !table[i].is_error);
128 EXPECT_FALSE(global_error_->GetBubbleViewTitle().empty()); 128 EXPECT_FALSE(global_error_->GetBubbleViewTitle().empty());
129 EXPECT_FALSE(global_error_->GetBubbleViewAcceptButtonLabel().empty()); 129 EXPECT_FALSE(global_error_->GetBubbleViewAcceptButtonLabel().empty());
130 EXPECT_TRUE(global_error_->GetBubbleViewCancelButtonLabel().empty()); 130 EXPECT_TRUE(global_error_->GetBubbleViewCancelButtonLabel().empty());
131 } 131 }
132 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698