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

Unified Diff: chrome/browser/devtools/devtools_window_testing.h

Issue 395783002: [DevTools] Move DevToolsWindow testing code to a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased, added cleanup to some tests Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/devtools/devtools_window_testing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_window_testing.h
diff --git a/chrome/browser/devtools/devtools_window_testing.h b/chrome/browser/devtools/devtools_window_testing.h
new file mode 100644
index 0000000000000000000000000000000000000000..396805a750f08e7a5afeef884aef838a4bcdc822
--- /dev/null
+++ b/chrome/browser/devtools/devtools_window_testing.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_TESTING_H_
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_TESTING_H_
+
+#include "base/callback.h"
+#include "chrome/browser/devtools/devtools_window.h"
+#include "ui/gfx/rect.h"
+
+class Browser;
+class Profile;
+
+namespace content {
+class DevToolsAgentHost;
+class RenderViewHost;
+class WebContents;
+}
+
+class DevToolsWindowTesting {
+ public:
+ virtual ~DevToolsWindowTesting();
+
+ // The following methods block until DevToolsWindow is completely loaded.
+ static DevToolsWindow* OpenDevToolsWindowSync(
+ content::RenderViewHost* inspected_rvh, bool is_docked);
+ static DevToolsWindow* OpenDevToolsWindowSync(
+ Browser* browser, bool is_docked);
+ static DevToolsWindow* OpenDevToolsWindowForWorkerSync(
+ Profile* profile, content::DevToolsAgentHost* worker_agent);
+
+ // Closes the window like it was user-initiated.
+ static void CloseDevToolsWindow(DevToolsWindow* window);
+ // Blocks until window is closed.
+ static void CloseDevToolsWindowSync(DevToolsWindow* window);
+
+ static DevToolsWindowTesting* Get(DevToolsWindow* window);
+
+ Browser* browser();
+ content::WebContents* main_web_contents();
+ content::WebContents* toolbox_web_contents();
+ void SetInspectedPageBounds(const gfx::Rect& bounds);
+ void SetCloseCallback(const base::Closure& closure);
+
+ private:
+ friend class DevToolsWindow;
+
+ explicit DevToolsWindowTesting(DevToolsWindow* window);
+ static void WaitForDevToolsWindowLoad(DevToolsWindow* window);
+ static void WindowClosed(DevToolsWindow* window);
+ static DevToolsWindowTesting* Find(DevToolsWindow* window);
+
+ DevToolsWindow* devtools_window_;
+ base::Closure close_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsWindowTesting);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_TESTING_H_
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/devtools/devtools_window_testing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698