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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc

Issue 15774015: Fixed problem with clicking on app launcher item (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed windows build issue Created 7 years, 7 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 | « ash/launcher/launcher_view.cc ('k') | ui/app_list/views/app_list_drag_and_drop_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc
index c843880c544fb8d94f2fec2807acc09d78df9445..46ce4122fec6f2f3da54f0318cbebe41e91b593f 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc
@@ -1448,6 +1448,42 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, DragAndDrop) {
EXPECT_EQ(3, model_->item_count()); // And it remains that way.
}
+// Check that clicking on an app launcher item launches a new browser.
+IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, ClickItem) {
+ // Get a number of interfaces we need.
+ aura::test::EventGenerator generator(
+ ash::Shell::GetPrimaryRootWindow(), gfx::Point());
+ ash::test::LauncherViewTestAPI test(launcher_->GetLauncherViewForTest());
+ AppListService* service = AppListService::Get();
+ // There should be two items in our launcher by this time.
+ EXPECT_EQ(2, model_->item_count());
+ EXPECT_FALSE(service->IsAppListVisible());
+
+ // Open the app list menu and check that the drag and drop host was set.
+ gfx::Rect app_list_bounds =
+ test.launcher_view()->GetAppListButtonView()->GetBoundsInScreen();
+ generator.MoveMouseTo(app_list_bounds.CenterPoint().x(),
+ app_list_bounds.CenterPoint().y());
+ generator.ClickLeftButton();
+ base::MessageLoop::current()->RunUntilIdle();
+
+ EXPECT_TRUE(service->IsAppListVisible());
+ app_list::AppsGridView* grid_view =
+ app_list::AppsGridView::GetLastGridViewForTest();
+ ASSERT_TRUE(grid_view);
+ const views::ViewModel* vm_grid = grid_view->view_model_for_test();
+ EXPECT_EQ(2, vm_grid->view_size());
+ gfx::Rect bounds_grid_1 = vm_grid->view_at(1)->GetBoundsInScreen();
+ // Test now that a click does create a new application tab.
+ TabStripModel* tab_strip = browser()->tab_strip_model();
+ int tab_count = tab_strip->count();
+ generator.MoveMouseTo(bounds_grid_1.CenterPoint().x(),
+ bounds_grid_1.CenterPoint().y());
+ generator.ClickLeftButton();
+ base::MessageLoop::current()->RunUntilIdle();
+ EXPECT_EQ(tab_count + 1, tab_strip->count());
+}
+
// Check LauncherItemController of Browser Shortcut functionality.
IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTestNoDefaultBrowser,
BrowserShortcutLauncherItemController) {
« no previous file with comments | « ash/launcher/launcher_view.cc ('k') | ui/app_list/views/app_list_drag_and_drop_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698