tab_drag_controller_interactive_uitest.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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  // 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
55namespace test {
56
57// Returns the TabStrip for |browser|.
58TabStrip* GetTabStripForBrowser(Browser* browser);
59
60// Returns the center of |view| in screen coordinates.
61gfx::Point GetCenterInScreenCoordinates(const views::View* view);
62
63// Sets the id of |web_contents| to |id|.
64void 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| ...
68void 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.
72std::string IDString(TabStripModel* model);
73
74}  // namespace test
75
76#endif  // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_INTERACTIVE_UITEST_H_
77