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

Side by Side Diff: ui/views/views_test_suite.cc

Issue 2807833002: [views-mus] Prevent creating a native OzonePlatform in mus tests. (Closed)
Patch Set: sky comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/views_test_suite.h" 5 #include "ui/views/views_test_suite.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #if defined(OS_MACOSX) 46 #if defined(OS_MACOSX)
47 gpu::ImageTransportSurface::SetAllowOSMesaForTesting(true); 47 gpu::ImageTransportSurface::SetAllowOSMesaForTesting(true);
48 #endif 48 #endif
49 49
50 ui::RegisterPathProvider(); 50 ui::RegisterPathProvider();
51 51
52 base::FilePath ui_test_pak_path; 52 base::FilePath ui_test_pak_path;
53 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); 53 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
54 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); 54 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
55 #if defined(USE_AURA) 55 #if defined(USE_AURA)
56 env_ = aura::Env::CreateInstance(); 56 InitializeEnv();
57 #endif 57 #endif
58 } 58 }
59 59
60 void ViewsTestSuite::Shutdown() { 60 void ViewsTestSuite::Shutdown() {
61 #if defined(USE_AURA) 61 #if defined(USE_AURA)
62 env_.reset(); 62 DestroyEnv();
63 #endif 63 #endif
64 ui::ResourceBundle::CleanupSharedInstance(); 64 ui::ResourceBundle::CleanupSharedInstance();
65 base::TestSuite::Shutdown(); 65 base::TestSuite::Shutdown();
66 } 66 }
67 67
68 #if defined(USE_AURA)
69 void ViewsTestSuite::InitializeEnv() {
70 env_ = aura::Env::CreateInstance();
71 }
72
73 void ViewsTestSuite::DestroyEnv() {
74 env_.reset();
75 }
76 #endif
77
68 } // namespace views 78 } // namespace views
OLDNEW
« ui/base/dragdrop/os_exchange_data_provider_factory.h ('K') | « ui/views/views_test_suite.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698