[Presentation API, Android] Implement basic messaging
[chromium-blink-merge.git] / chrome / browser / devtools / devtools_window_testing.h
blobf987bf0185c7b1c4a62cfe7fea2696180a705000
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_TESTING_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_TESTING_H_
8 #include "base/callback.h"
9 #include "chrome/browser/devtools/devtools_window.h"
10 #include "ui/gfx/geometry/rect.h"
12 class Browser;
13 class Profile;
15 namespace content {
16 class DevToolsAgentHost;
17 class WebContents;
20 class DevToolsWindowTesting {
21 public:
22 virtual ~DevToolsWindowTesting();
24 // The following methods block until DevToolsWindow is completely loaded.
25 static DevToolsWindow* OpenDevToolsWindowSync(
26 content::WebContents* inspected_web_contents,
27 bool is_docked);
28 static DevToolsWindow* OpenDevToolsWindowSync(
29 Browser* browser, bool is_docked);
30 static DevToolsWindow* OpenDevToolsWindowForWorkerSync(
31 Profile* profile, content::DevToolsAgentHost* worker_agent);
33 // Closes the window like it was user-initiated.
34 static void CloseDevToolsWindow(DevToolsWindow* window);
35 // Blocks until window is closed.
36 static void CloseDevToolsWindowSync(DevToolsWindow* window);
38 static DevToolsWindowTesting* Get(DevToolsWindow* window);
40 Browser* browser();
41 content::WebContents* main_web_contents();
42 content::WebContents* toolbox_web_contents();
43 void SetInspectedPageBounds(const gfx::Rect& bounds);
44 void SetCloseCallback(const base::Closure& closure);
46 private:
47 friend class DevToolsWindow;
49 explicit DevToolsWindowTesting(DevToolsWindow* window);
50 static void WaitForDevToolsWindowLoad(DevToolsWindow* window);
51 static void WindowClosed(DevToolsWindow* window);
52 static DevToolsWindowTesting* Find(DevToolsWindow* window);
54 DevToolsWindow* devtools_window_;
55 base::Closure close_callback_;
57 DISALLOW_COPY_AND_ASSIGN(DevToolsWindowTesting);
60 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_TESTING_H_