tab_drag_controller_interactive_uitest.h revision c2db58bd994c04d98e4ee2cd7565b71548655fe3
1// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_INTERACTIVE_UITEST_H_ 6#define CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_INTERACTIVE_UITEST_H_ 7 8#include <string> 9 10#include "chrome/test/base/in_process_browser_test.h" 11 12class Browser; 13class BrowserList; 14class TabStrip; 15class TabStripModel; 16 17namespace content { 18class WebContents; 19} 20 21namespace gfx { 22class Point; 23} 24 25namespace views { 26class View; 27} 28 29// TabDragControllerTest is the basis for the two tests that exercise 30// TabDragController. 31class TabDragControllerTest : public InProcessBrowserTest { 32 public: 33 TabDragControllerTest(); 34 virtual ~TabDragControllerTest(); 35 36 virtual void SetUp() OVERRIDE; 37 38 // Cover for TabStrip::StopAnimating(true). 39 void StopAnimating(TabStrip* tab_strip); 40 41 // Adds a new blank tab to |browser|, stops animations and resets the ids of 42 // the tabs in |browser|. 43 void AddTabAndResetBrowser(Browser* browser); 44 45 // Creates a new Browser and resizes |browser()| and the new browser to be 46 // side by side. 47 Browser* CreateAnotherWindowBrowserAndRelayout(); 48 49 // The tab drag controller interactive ui tests only use the native desktop 50 // for now. 51 const BrowserList* native_browser_list; 52 53 private: 54 DISALLOW_COPY_AND_ASSIGN(TabDragControllerTest); 55}; 56 57namespace test { 58 59// Returns the TabStrip for |browser|. 60TabStrip* GetTabStripForBrowser(Browser* browser); 61 62// Returns the center of |view| in screen coordinates. 63gfx::Point GetCenterInScreenCoordinates(const views::View* view); 64 65// Sets the id of |web_contents| to |id|. 66void SetID(content::WebContents* web_contents, int id); 67 68// Resets the ids of all the tabs in |model| starting at |start|. That is, the 69// id of the first tab is set to |start|, the second tab |start + 1| ... 70void ResetIDs(TabStripModel* model, int start); 71 72// Returns a string representation of the ids of the tabs in |model|. Each id 73// is separated by a space. 74std::string IDString(TabStripModel* model); 75 76} // namespace test 77 78#endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_INTERACTIVE_UITEST_H_ 79