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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc

Issue 229453005: Shelf Cleanup AlternateShelfLayout P1 Attempt 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "apps/ui/native_app_window.h" 9 #include "apps/ui/native_app_window.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
11 #include "ash/display/display_controller.h" 11 #include "ash/display/display_controller.h"
12 #include "ash/shelf/shelf.h" 12 #include "ash/shelf/shelf.h"
13 #include "ash/shelf/shelf_button.h" 13 #include "ash/shelf/shelf_button.h"
14 #include "ash/shelf/shelf_constants.h"
14 #include "ash/shelf/shelf_model.h" 15 #include "ash/shelf/shelf_model.h"
15 #include "ash/shelf/shelf_util.h" 16 #include "ash/shelf/shelf_util.h"
16 #include "ash/shelf/shelf_view.h" 17 #include "ash/shelf/shelf_view.h"
17 #include "ash/shell.h" 18 #include "ash/shell.h"
18 #include "ash/test/app_list_controller_test_api.h" 19 #include "ash/test/app_list_controller_test_api.h"
19 #include "ash/test/shelf_test_api.h" 20 #include "ash/test/shelf_test_api.h"
20 #include "ash/test/shelf_view_test_api.h" 21 #include "ash/test/shelf_view_test_api.h"
21 #include "ash/test/shell_test_api.h" 22 #include "ash/test/shell_test_api.h"
22 #include "ash/wm/window_state.h" 23 #include "ash/wm/window_state.h"
23 #include "ash/wm/window_util.h" 24 #include "ash/wm/window_util.h"
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 shelf_model()->items()[shelf_item_count - 1]; 814 shelf_model()->items()[shelf_item_count - 1];
814 const LauncherItemController* app_item_controller = 815 const LauncherItemController* app_item_controller =
815 GetItemController(app_item.id); 816 GetItemController(app_item.id);
816 const LauncherItemController* panel_item_controller = 817 const LauncherItemController* panel_item_controller =
817 GetItemController(panel_item.id); 818 GetItemController(panel_item.id);
818 // Icons for Apps are set by the AppWindowLauncherController, so 819 // Icons for Apps are set by the AppWindowLauncherController, so
819 // image_set_by_controller() should be set. 820 // image_set_by_controller() should be set.
820 EXPECT_TRUE(app_item_controller->image_set_by_controller()); 821 EXPECT_TRUE(app_item_controller->image_set_by_controller());
821 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); 822 EXPECT_TRUE(panel_item_controller->image_set_by_controller());
822 // Ensure icon heights are correct (see test.js in app_icon/ test directory) 823 // Ensure icon heights are correct (see test.js in app_icon/ test directory)
823 EXPECT_EQ(48, app_item.image.height()); 824 EXPECT_EQ(ash::kShelfSize, app_item.image.height());
824 EXPECT_EQ(64, panel_item.image.height()); 825 EXPECT_EQ(64, panel_item.image.height());
825 } 826 }
826 827
827 // Test that we can launch an app with a shortcut. 828 // Test that we can launch an app with a shortcut.
828 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { 829 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) {
829 TabStripModel* tab_strip = browser()->tab_strip_model(); 830 TabStripModel* tab_strip = browser()->tab_strip_model();
830 int tab_count = tab_strip->count(); 831 int tab_count = tab_strip->count();
831 ash::ShelfID shortcut_id = CreateShortcut("app1"); 832 ash::ShelfID shortcut_id = CreateShortcut("app1");
832 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); 833 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status);
833 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); 834 ActivateShelfItem(model_->ItemIndexByID(shortcut_id));
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 GURL("http://www.foo.com/bar.html")); 2024 GURL("http://www.foo.com/bar.html"));
2024 // Make sure the navigation was entirely performed. 2025 // Make sure the navigation was entirely performed.
2025 base::MessageLoop::current()->RunUntilIdle(); 2026 base::MessageLoop::current()->RunUntilIdle();
2026 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); 2027 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status);
2027 app_browser->tab_strip_model()->CloseWebContentsAt(0, 2028 app_browser->tab_strip_model()->CloseWebContentsAt(0,
2028 TabStripModel::CLOSE_NONE); 2029 TabStripModel::CLOSE_NONE);
2029 // Make sure that the app is really gone. 2030 // Make sure that the app is really gone.
2030 base::MessageLoop::current()->RunUntilIdle(); 2031 base::MessageLoop::current()->RunUntilIdle();
2031 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); 2032 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status);
2032 } 2033 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698