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

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

Issue 12502017: signin: pull basic SigninManager functionality into new SigninManagerBase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: deal with new enterprise_platform_keys_private_api Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/signin/signin_global_error.cc ('k') | chrome/browser/signin/signin_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/signin/fake_auth_status_provider.h" 8 #include "chrome/browser/signin/fake_auth_status_provider.h"
9 #include "chrome/browser/signin/fake_signin_manager.h" 9 #include "chrome/browser/signin/fake_signin_manager.h"
10 #include "chrome/browser/signin/signin_manager.h" 10 #include "chrome/browser/signin/signin_manager.h"
11 #include "chrome/browser/signin/signin_manager_factory.h" 11 #include "chrome/browser/signin/signin_manager_factory.h"
12 #include "chrome/browser/signin/token_service_factory.h" 12 #include "chrome/browser/signin/token_service_factory.h"
13 #include "chrome/browser/ui/global_error/global_error_service.h" 13 #include "chrome/browser/ui/global_error/global_error_service.h"
14 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 14 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
15 #include "chrome/test/base/testing_profile.h" 15 #include "chrome/test/base/testing_profile.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 class SigninGlobalErrorTest : public testing::Test { 18 class SigninGlobalErrorTest : public testing::Test {
19 public: 19 public:
20 virtual void SetUp() OVERRIDE { 20 virtual void SetUp() OVERRIDE {
21 // Create a signed-in profile. 21 // Create a signed-in profile.
22 profile_.reset(new TestingProfile()); 22 profile_.reset(new TestingProfile());
23 23
24 SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse( 24 SigninManagerBase* manager = static_cast<SigninManagerBase*>(
25 profile_.get(), FakeSigninManager::Build); 25 SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse(
26 SigninManager* manager = 26 profile_.get(), FakeSigninManagerBase::Build));
27 SigninManagerFactory::GetForProfile(profile_.get()); 27 manager->SetAuthenticatedUsername("testuser@test.com");
28 manager->SetAuthenticatedUsername("testuser@test.com");
29 global_error_ = manager->signin_global_error(); 28 global_error_ = manager->signin_global_error();
30 } 29 }
31 30
32 scoped_ptr<TestingProfile> profile_; 31 scoped_ptr<TestingProfile> profile_;
33 SigninGlobalError* global_error_; 32 SigninGlobalError* global_error_;
34 }; 33 };
35 34
36 TEST_F(SigninGlobalErrorTest, NoAuthStatusProviders) { 35 TEST_F(SigninGlobalErrorTest, NoAuthStatusProviders) {
37 ASSERT_FALSE(global_error_->HasMenuItem()); 36 ASSERT_FALSE(global_error_->HasMenuItem());
38 } 37 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // menu item to display auth status/errors. 116 // menu item to display auth status/errors.
118 EXPECT_EQ(global_error_->HasMenuItem(), table[i].is_error); 117 EXPECT_EQ(global_error_->HasMenuItem(), table[i].is_error);
119 EXPECT_EQ(global_error_->MenuItemLabel().empty(), !table[i].is_error); 118 EXPECT_EQ(global_error_->MenuItemLabel().empty(), !table[i].is_error);
120 EXPECT_EQ(global_error_->GetBubbleViewMessages().empty(), 119 EXPECT_EQ(global_error_->GetBubbleViewMessages().empty(),
121 !table[i].is_error); 120 !table[i].is_error);
122 EXPECT_FALSE(global_error_->GetBubbleViewTitle().empty()); 121 EXPECT_FALSE(global_error_->GetBubbleViewTitle().empty());
123 EXPECT_FALSE(global_error_->GetBubbleViewAcceptButtonLabel().empty()); 122 EXPECT_FALSE(global_error_->GetBubbleViewAcceptButtonLabel().empty());
124 EXPECT_TRUE(global_error_->GetBubbleViewCancelButtonLabel().empty()); 123 EXPECT_TRUE(global_error_->GetBubbleViewCancelButtonLabel().empty());
125 } 124 }
126 } 125 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_global_error.cc ('k') | chrome/browser/signin/signin_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698