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

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..5ed916224c553ffbdf688601d2ce6e28250b7533 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,44 @@ 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 {
sky 2015/07/20 23:09:08 Can this be moved to the test?
msw 2015/07/20 23:47:08 I asked for this code to be consolidated, refined,
+ 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(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(
+ Browser::CreateParams* params);
+
+#if defined(USE_AURA)
+// Helper that creates a browser with a native Aura |window|. If |window| is
+// nullptr, it will create an Aura window to associate with the browser. It also
+// handles the lifetime of TestBrowserWindowAura.
+scoped_ptr<Browser> CreateBrowserWithAuraTestWindowForParams(
+ scoped_ptr<aura::Window> window,
+ 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