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

Unified Diff: chrome/browser/sync/sync_error_notifier_ash_unittest.cc

Issue 344833004: aura: Make sure TestScreen objects are destroyed properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 6 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/signin/signin_error_notifier_ash_unittest.cc ('k') | content/shell/browser/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_error_notifier_ash_unittest.cc
diff --git a/chrome/browser/sync/sync_error_notifier_ash_unittest.cc b/chrome/browser/sync/sync_error_notifier_ash_unittest.cc
index dd7864c5e475a639886de97bfedbeea62e2ec9dd..482ae521de1b4595b18f03f4ca63a717f838dee7 100644
--- a/chrome/browser/sync/sync_error_notifier_ash_unittest.cc
+++ b/chrome/browser/sync/sync_error_notifier_ash_unittest.cc
@@ -22,7 +22,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/message_center/notification.h"
-#if !defined(OS_CHROMEOS)
+#if defined(OS_WIN)
#include "chrome/browser/ui/ash/ash_util.h"
#include "ui/aura/test/test_screen.h"
#include "ui/gfx/screen.h"
@@ -45,7 +45,7 @@ static const char kTestAccountId[] = "testuser@test.com";
static const std::string kNotificationId =
"chrome://settings/sync/testuser@test.com";
-#if !defined(OS_CHROMEOS)
+#if defined(OS_WIN)
class ScreenTypeDelegateDesktop : public gfx::ScreenTypeDelegate {
public:
ScreenTypeDelegateDesktop() {}
@@ -109,8 +109,8 @@ class SyncErrorNotifierTest : public AshTestBase {
// Set up a desktop screen for Windows to hold native widgets, used when
// adding desktop widgets (i.e., message center notifications).
#if defined(OS_WIN)
- aura::TestScreen* test_screen = aura::TestScreen::Create(gfx::Size());
- gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen);
+ test_screen_.reset(aura::TestScreen::Create(gfx::Size()));
+ gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get());
gfx::Screen::SetScreenTypeDelegate(new ScreenTypeDelegateDesktop);
#endif
@@ -131,6 +131,9 @@ class SyncErrorNotifierTest : public AshTestBase {
virtual void TearDown() OVERRIDE {
error_notifier_->Shutdown();
service_.reset();
+#if defined(OS_WIN)
+ test_screen_.reset();
+#endif
profile_manager_.reset();
AshTestBase::TearDown();
@@ -165,6 +168,9 @@ class SyncErrorNotifierTest : public AshTestBase {
}
}
+#if defined(OS_WIN)
+ scoped_ptr<gfx::Screen> test_screen_;
+#endif
scoped_ptr<TestingProfileManager> profile_manager_;
scoped_ptr<SyncErrorController> error_controller_;
scoped_ptr<SyncErrorNotifier> error_notifier_;
« no previous file with comments | « chrome/browser/signin/signin_error_notifier_ash_unittest.cc ('k') | content/shell/browser/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698