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

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: rebase 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..2836ceb239963f50052fae75badfaf2f0a9a6e19 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.
@@ -136,13 +120,16 @@ TEST_F(AppListViewControllerTest, SignedIn) {
}
// Test the view when signin is required.
-TEST_F(AppListViewControllerSigninTest, NeedsSignin) {
+TEST_F(AppListViewControllerTest, NeedsSignin) {
+ // Begin the test with a signed out app list.
+ scoped_ptr<AppListModel> new_model(new AppListModel);
+ new_model->SetSignedIn(false);
+ ResetModel(new_model.Pass());
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;
- NotifySigninSuccess();
+ model()->SetSignedIn(true);
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