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

Unified Diff: ui/app_list/cocoa/test/apps_grid_controller_test_helper.h

Issue 12701022: wrongbaseurl OSX App List Pager and root view controller. (Closed) Base URL: http://git.chromium.org/chromium/src.git@20130304-crbug-138633-osx-app-list-demo-polish-macbook
Patch Set: delegate should be owned by viewcontroller, test coverage Created 7 years, 9 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
Index: ui/app_list/cocoa/test/apps_grid_controller_test_helper.h
diff --git a/ui/app_list/cocoa/test/apps_grid_controller_test_helper.h b/ui/app_list/cocoa/test/apps_grid_controller_test_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a134e82800a99f48e1c0e6c7053b7fafc047174
--- /dev/null
+++ b/ui/app_list/cocoa/test/apps_grid_controller_test_helper.h
@@ -0,0 +1,64 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_COCOA_TEST_APPS_GRID_CONTROLLER_TEST_HELPER_H_
+#define UI_APP_LIST_COCOA_TEST_APPS_GRID_CONTROLLER_TEST_HELPER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/message_loop.h"
+#import "ui/base/test/ui_cocoa_test_helper.h"
+
+@class AppsGridController;
+
+namespace app_list {
+namespace test {
+
+class AppListTestViewDelegate;
+class AppListTestModel;
+
+class AppsGridControllerTestHelper : public ui::CocoaTest {
+ public:
+ static const size_t kItemsPerPage;
+
+ AppsGridControllerTestHelper();
+ virtual ~AppsGridControllerTestHelper();
+
+ void SetUpWithGridController(AppsGridController* grid_controller);
+
+ protected:
+ // Send a click to the test window in the centre of |view|.
+ void SimulateClick(NSView* view);
+
+ // Send a key press to the first responder.
+ void SimulateKeyPress(unichar c);
+
+ void SimulateMouseEnterItemAt(size_t index);
+ void SimulateMouseExitItemAt(size_t index);
+
+ // Do a bulk replacement of the items in the grid.
+ void ReplaceTestModel(int item_count);
+
+ void DelayForCollectionView();
+ void SinkEvents();
+
+ NSButton* GetItemViewAt(size_t index);
+ NSCollectionView* GetPageAt(size_t index);
+ NSView* GetSelectedView();
+
+ AppListTestViewDelegate* delegate();
+ AppListTestModel* model();
+
+ scoped_ptr<AppListTestViewDelegate> delegate_;
+ AppsGridController* apps_grid_controller_;
+
+ private:
+ MessageLoopForUI message_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppsGridControllerTestHelper);
+};
+
+} // namespace test
+} // namespace app_list
+
+#endif // UI_APP_LIST_COCOA_TEST_APPS_GRID_CONTROLLER_TEST_HELPER_H_
« no previous file with comments | « ui/app_list/cocoa/apps_pagination_model_observer.h ('k') | ui/app_list/cocoa/test/apps_grid_controller_test_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698