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

Unified Diff: ui/app_list/cocoa/app_list_view_controller_unittest.mm

Issue 22268009: Move signin status and current user information into AppListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 7 years, 4 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 | « ui/app_list/cocoa/app_list_view_controller.mm ('k') | ui/app_list/cocoa/apps_search_box_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]);
« no previous file with comments | « ui/app_list/cocoa/app_list_view_controller.mm ('k') | ui/app_list/cocoa/apps_search_box_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698