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

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

Issue 1998933002: Update shelf spacing in Chrome OS according to the MD specs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 6 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
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_impl.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 shelf_model()->items()[shelf_item_count - 1]; 851 shelf_model()->items()[shelf_item_count - 1];
852 const LauncherItemController* app_item_controller = 852 const LauncherItemController* app_item_controller =
853 GetItemController(app_item.id); 853 GetItemController(app_item.id);
854 const LauncherItemController* panel_item_controller = 854 const LauncherItemController* panel_item_controller =
855 GetItemController(panel_item.id); 855 GetItemController(panel_item.id);
856 // Icons for Apps are set by the AppWindowLauncherController, so 856 // Icons for Apps are set by the AppWindowLauncherController, so
857 // image_set_by_controller() should be set. 857 // image_set_by_controller() should be set.
858 EXPECT_TRUE(app_item_controller->image_set_by_controller()); 858 EXPECT_TRUE(app_item_controller->image_set_by_controller());
859 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); 859 EXPECT_TRUE(panel_item_controller->image_set_by_controller());
860 // Ensure icon heights are correct (see test.js in app_icon/ test directory) 860 // Ensure icon heights are correct (see test.js in app_icon/ test directory)
861 EXPECT_EQ(ash::kShelfSize, app_item.image.height()); 861 EXPECT_EQ(ash::GetShelfConstant(ash::SHELF_SIZE), app_item.image.height());
862 EXPECT_EQ(64, panel_item.image.height()); 862 EXPECT_EQ(64, panel_item.image.height());
863 } 863 }
864 864
865 // Test that we can launch an app with a shortcut. 865 // Test that we can launch an app with a shortcut.
866 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { 866 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) {
867 TabStripModel* tab_strip = browser()->tab_strip_model(); 867 TabStripModel* tab_strip = browser()->tab_strip_model();
868 int tab_count = tab_strip->count(); 868 int tab_count = tab_strip->count();
869 ash::ShelfID shortcut_id = CreateShortcut("app1"); 869 ash::ShelfID shortcut_id = CreateShortcut("app1");
870 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); 870 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status);
871 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); 871 ActivateShelfItem(model_->ItemIndexByID(shortcut_id));
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 // Close all windows. 2295 // Close all windows.
2296 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); 2296 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE);
2297 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); 2297 EXPECT_EQ(0u, BrowserList::GetInstance()->size());
2298 2298
2299 // Check if "Close" is removed from the context menu. 2299 // Check if "Close" is removed from the context menu.
2300 std::unique_ptr<LauncherContextMenu> menu2 = 2300 std::unique_ptr<LauncherContextMenu> menu2 =
2301 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT); 2301 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT);
2302 ASSERT_FALSE( 2302 ASSERT_FALSE(
2303 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); 2303 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE));
2304 } 2304 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/apps/chrome_app_delegate.cc ('k') | chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698