Index: ui/app_list/cocoa/app_list_view_controller_unittest.mm |
diff --git a/ui/app_list/cocoa/app_list_view_controller_unittest.mm b/ui/app_list/cocoa/app_list_view_controller_unittest.mm |
index 70769aba759f0dce5a43c596efbd14c6bf34df96..3e75dd7f5cc5d28c93bfcf49573056f3554f11f5 100644 |
--- a/ui/app_list/cocoa/app_list_view_controller_unittest.mm |
+++ b/ui/app_list/cocoa/app_list_view_controller_unittest.mm |
@@ -67,22 +67,6 @@ class AppListViewControllerTest : public AppsGridControllerTestHelper, |
DISALLOW_COPY_AND_ASSIGN(AppListViewControllerTest); |
}; |
-// Helper class allowing NeedSignin() to return true during SetUp(), to test an |
-// initial state where signin is required, and the regular view starts hidden. |
-class AppListViewControllerSigninTest : public AppListViewControllerTest { |
- public: |
- AppListViewControllerSigninTest() : needs_signin_(true) {} |
- |
- // SigninDelegate override: |
- virtual bool NeedSignin() OVERRIDE { return needs_signin_; } |
- |
- protected: |
- bool needs_signin_; |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(AppListViewControllerSigninTest); |
-}; |
- |
TEST_VIEW(AppListViewControllerTest, [app_list_view_controller_ view]); |
// Test that adding and removing pages updates the pager. |
@@ -130,18 +114,21 @@ TEST_F(AppListViewControllerTest, PagerChangingPage) { |
// Test the view when the user is already signed in. |
TEST_F(AppListViewControllerTest, SignedIn) { |
+ scoped_ptr<AppListModel> model(new AppListModel); |
+ model->SetSignedIn(true); |
tapted
2013/08/16 05:09:14
I think this needs to be the default. Otherwise, t
calamity
2013/08/16 07:24:05
Done.
|
+ ResetModel(model.Pass()); |
// There should be just 1, visible subview when signed in. |
EXPECT_EQ(1u, [[[app_list_view_controller_ view] subviews] count]); |
EXPECT_FALSE([[app_list_view_controller_ backgroundView] isHidden]); |
} |
// Test the view when signin is required. |
-TEST_F(AppListViewControllerSigninTest, NeedsSignin) { |
+TEST_F(AppListViewControllerTest, NeedsSignin) { |
EXPECT_EQ(2u, [[[app_list_view_controller_ view] subviews] count]); |
EXPECT_TRUE([[app_list_view_controller_ backgroundView] isHidden]); |
// Simulate signing in, should enter the SignedIn state. |
- needs_signin_ = false; |
+ model()->SetSignedIn(true); |
NotifySigninSuccess(); |
tapted
2013/08/16 05:09:14
Thanks to your refactoring, I think this line is n
calamity
2013/08/16 07:24:05
Done.
|
EXPECT_EQ(1u, [[[app_list_view_controller_ view] subviews] count]); |
EXPECT_FALSE([[app_list_view_controller_ backgroundView] isHidden]); |