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

Unified Diff: chrome/test/base/test_browser_window.h

Issue 1198313003: Fix the browser match rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address msw@'s comments. Created 5 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/chrome_tests_unit.gypi ('k') | chrome/test/base/test_browser_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/test_browser_window.h
diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h
index 57c43fa41ddf20d85c4f415bc22f74a33f5d8c5b..f99f4c1447da5997cd8d09f5325e8568c0d58d97 100644
--- a/chrome/test/base/test_browser_window.h
+++ b/chrome/test/base/test_browser_window.h
@@ -13,6 +13,10 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/location_bar/location_bar.h"
+#if defined(USE_AURA)
+#include "ui/aura/window.h"
+#endif
+
class LocationBarTesting;
class OmniboxView;
@@ -192,10 +196,48 @@ class TestBrowserWindow : public BrowserWindow {
DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow);
};
+#if defined(USE_AURA)
+// A browser window proxy with an associated Aura native window.
+class TestBrowserWindowAura : public TestBrowserWindow {
+ public:
+ explicit TestBrowserWindowAura(scoped_ptr<aura::Window> native_window);
+ ~TestBrowserWindowAura() override;
+
+ // TestBrowserWindow overrides:
+ gfx::NativeWindow GetNativeWindow() const override;
+ void Show() override;
+ void Hide() override;
+ gfx::Rect GetBounds() const override;
+
+ scoped_ptr<Browser> CreateBrowser(const Browser::CreateParams& params);
+
+ private:
+ Browser* browser_; // not owned
+ scoped_ptr<aura::Window> native_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura);
+};
+#endif // defined(USE_AURA)
+
namespace chrome {
// Helper that handle the lifetime of TestBrowserWindow instances.
-Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params);
+scoped_ptr<Browser> CreateBrowserWithTestWindowForParams(
xdai1 2015/07/08 21:34:21 For consistency, also made CreateBrowserWithTestWi
+ Browser::CreateParams* params);
+
+#if defined(USE_AURA)
+// Helper that creates a browser which has a native aura window. It also handles
+// the lifetime of TestBrowserWindowAura.
+scoped_ptr<Browser> CreateBrowserWithAuraTestWindowForParams(
+ const Browser::CreateParams& params);
+
+// Helper that creates a browser for a native aura window. It also handles the
+// lifetime of TestBrowserWindowAura.
+scoped_ptr<Browser> CreateBrowserForAuraTestWindowAndParams(
+ scoped_ptr<aura::Window> window,
+ const Browser::CreateParams& params);
+
+#endif // defined(USE_AURA)
} // namespace chrome
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/base/test_browser_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698