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

Unified Diff: chrome/test/base/browser_with_test_window_test.cc

Issue 105813013: Adds views::corewm::WMState to install common state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix viewseventtestbase Created 7 years 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/test/base/browser_with_test_window_test.h ('k') | chrome/test/base/view_event_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/browser_with_test_window_test.cc
diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc
index bf97a7914eebfbfbf000c1746d8dea7c33368eb7..f3341c46f8f741812828a0b15d765ac5247584ae 100644
--- a/chrome/test/base/browser_with_test_window_test.cc
+++ b/chrome/test/base/browser_with_test_window_test.cc
@@ -25,6 +25,10 @@
#include "ash/test/ash_test_helper.h"
#endif
+#if defined(TOOLKIT_VIEWS)
+#include "ui/views/test/test_views_delegate.h"
+#endif
+
using content::NavigationController;
using content::RenderViewHost;
using content::RenderViewHostTester;
@@ -57,6 +61,10 @@ void BrowserWithTestWindowTest::SetUp() {
base::MessageLoopForUI::current()));
aura_test_helper_->SetUp();
#endif // USE_AURA
+#if defined(TOOLKIT_VIEWS)
+ views_delegate_.reset(CreateViewsDelegate());
+ views::ViewsDelegate::views_delegate = views_delegate_.get();
+#endif
// Subclasses can provide their own Profile.
profile_ = CreateProfile();
@@ -89,6 +97,11 @@ void BrowserWithTestWindowTest::TearDown() {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::MessageLoop::QuitClosure());
base::MessageLoop::current()->Run();
+
+#if defined(TOOLKIT_VIEWS)
+ views::ViewsDelegate::views_delegate = NULL;
+ views_delegate_.reset(NULL);
+#endif
}
void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) {
@@ -202,3 +215,9 @@ Browser* BrowserWithTestWindowTest::CreateBrowser(
params.window = browser_window;
return new Browser(params);
}
+
+#if defined(TOOLKIT_VIEWS)
+views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() {
+ return new views::TestViewsDelegate;
+}
+#endif
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.h ('k') | chrome/test/base/view_event_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698