OLD | NEW |
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/signin_manager.h" | 9 #include "chrome/browser/signin/signin_manager.h" |
10 #include "chrome/browser/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
11 #include "chrome/browser/signin/signin_manager_fake.h" | 11 #include "chrome/browser/signin/signin_manager_fake.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 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 SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse( |
25 profile_.get(), FakeSigninManager::Build); | 25 profile_.get(), FakeSigninManager::Build); |
26 SigninManager* manager = | 26 SigninManager* manager = |
27 SigninManagerFactory::GetForProfile(profile_.get()); | 27 SigninManagerFactory::GetForProfile(profile_.get()); |
28 manager->SetAuthenticatedUsername("testuser@test.com"); | 28 manager->SetAuthenticatedUsername("testuser@test.com"); |
29 global_error_ = manager->signin_global_error(); | 29 global_error_ = manager->signin_global_error(); |
30 } | 30 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 EXPECT_FALSE(global_error_->HasMenuItem()); | 125 EXPECT_FALSE(global_error_->HasMenuItem()); |
126 #endif | 126 #endif |
127 EXPECT_EQ(global_error_->MenuItemLabel().empty(), !table[i].is_error); | 127 EXPECT_EQ(global_error_->MenuItemLabel().empty(), !table[i].is_error); |
128 EXPECT_EQ(global_error_->GetBubbleViewMessage().empty(), | 128 EXPECT_EQ(global_error_->GetBubbleViewMessage().empty(), |
129 !table[i].is_error); | 129 !table[i].is_error); |
130 EXPECT_FALSE(global_error_->GetBubbleViewTitle().empty()); | 130 EXPECT_FALSE(global_error_->GetBubbleViewTitle().empty()); |
131 EXPECT_FALSE(global_error_->GetBubbleViewAcceptButtonLabel().empty()); | 131 EXPECT_FALSE(global_error_->GetBubbleViewAcceptButtonLabel().empty()); |
132 EXPECT_TRUE(global_error_->GetBubbleViewCancelButtonLabel().empty()); | 132 EXPECT_TRUE(global_error_->GetBubbleViewCancelButtonLabel().empty()); |
133 } | 133 } |
134 } | 134 } |
OLD | NEW |