Home | History | Annotate | Download | only in tabs
      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 
     12 class Browser;
     13 class BrowserList;
     14 class TabStrip;
     15 class TabStripModel;
     16 
     17 namespace content {
     18 class WebContents;
     19 }
     20 
     21 namespace gfx {
     22 class Point;
     23 }
     24 
     25 namespace views {
     26 class View;
     27 }
     28 
     29 // TabDragControllerTest is the basis for the two tests that exercise
     30 // TabDragController.
     31 class TabDragControllerTest : public InProcessBrowserTest {
     32  public:
     33   TabDragControllerTest();
     34   virtual ~TabDragControllerTest();
     35 
     36   // Cover for TabStrip::StopAnimating(true).
     37   void StopAnimating(TabStrip* tab_strip);
     38 
     39   // Adds a new blank tab to |browser|, stops animations and resets the ids of
     40   // the tabs in |browser|.
     41   void AddTabAndResetBrowser(Browser* browser);
     42 
     43   // Creates a new Browser and resizes |browser()| and the new browser to be
     44   // side by side.
     45   Browser* CreateAnotherWindowBrowserAndRelayout();
     46 
     47   // The tab drag controller interactive ui tests only use the native desktop
     48   // for now.
     49   const BrowserList* native_browser_list;
     50 
     51  private:
     52   DISALLOW_COPY_AND_ASSIGN(TabDragControllerTest);
     53 };
     54 
     55 namespace test {
     56 
     57 // Returns the TabStrip for |browser|.
     58 TabStrip* GetTabStripForBrowser(Browser* browser);
     59 
     60 // Returns the center of |view| in screen coordinates.
     61 gfx::Point GetCenterInScreenCoordinates(const views::View* view);
     62 
     63 // Sets the id of |web_contents| to |id|.
     64 void SetID(content::WebContents* web_contents, int id);
     65 
     66 // Resets the ids of all the tabs in |model| starting at |start|. That is, the
     67 // id of the first tab is set to |start|, the second tab |start + 1| ...
     68 void ResetIDs(TabStripModel* model, int start);
     69 
     70 // Returns a string representation of the ids of the tabs in |model|. Each id
     71 // is separated by a space.
     72 std::string IDString(TabStripModel* model);
     73 
     74 }  // namespace test
     75 
     76 #endif  // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_INTERACTIVE_UITEST_H_
     77