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

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

Issue 280863002: Reduce creation of ViewsDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add widget includes for undef CreateWindow Created 6 years, 7 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/test/base/browser_with_test_window_test.h ('k') | ui/views/test/test_views_delegate.cc » ('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 e5de4b2a3bcc818c41b4fabd0ba1916b329ee7b0..5d7cd98cc4d2149691e8360ff125694c5ee3e78b 100644
--- a/chrome/test/base/browser_with_test_window_test.cc
+++ b/chrome/test/base/browser_with_test_window_test.cc
@@ -25,6 +25,7 @@
#if defined(USE_ASH)
#include "ash/test/ash_test_helper.h"
+#include "ash/test/ash_test_views_delegate.h"
#endif
#if defined(TOOLKIT_VIEWS)
@@ -59,7 +60,8 @@ void BrowserWithTestWindowTest::SetUp() {
#if defined(OS_CHROMEOS)
// TODO(jamescook): Windows Ash support. This will require refactoring
// AshTestHelper and AuraTestHelper so they can be used at the same time,
- // perhaps by AshTestHelper owning an AuraTestHelper.
+ // perhaps by AshTestHelper owning an AuraTestHelper. Also, need to cleanup
+ // CreateViewsDelegate() below when cleanup done.
ash_test_helper_.reset(new ash::test::AshTestHelper(
base::MessageLoopForUI::current()));
ash_test_helper_->SetUp(true);
@@ -73,9 +75,8 @@ void BrowserWithTestWindowTest::SetUp() {
aura_test_helper_->SetUp();
new wm::DefaultActivationClient(aura_test_helper_->root_window());
#endif // USE_AURA
-#if defined(TOOLKIT_VIEWS)
+#if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS)
views_delegate_.reset(CreateViewsDelegate());
- views::ViewsDelegate::views_delegate = views_delegate_.get();
#endif
// Subclasses can provide their own Profile.
@@ -113,7 +114,6 @@ void BrowserWithTestWindowTest::TearDown() {
base::MessageLoop::current()->Run();
#if defined(TOOLKIT_VIEWS)
- views::ViewsDelegate::views_delegate = NULL;
views_delegate_.reset(NULL);
#endif
}
@@ -241,8 +241,12 @@ Browser* BrowserWithTestWindowTest::CreateBrowser(
return new Browser(params);
}
-#if defined(TOOLKIT_VIEWS)
+#if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS)
views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() {
+#if defined(USE_ASH)
+ return new ash::test::AshTestViewsDelegate;
+#else
return new views::TestViewsDelegate;
+#endif
}
#endif
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.h ('k') | ui/views/test/test_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698