blob: 55e46a604ce70d1cdf1a440fc486dd4140d7b921 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/i18n/icu_util.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "ui/aura/env.h"
#include "ui/base/ime/input_method_initializer.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/gfx/screen.h"
#include "ui/gl/gl_surface.h"
#include "ui/views/examples/example_base.h"
#include "ui/views/examples/examples_window.h"
#include "ui/views/test/desktop_test_views_delegate.h"
#include "ui/wm/core/wm_state.h"
#if !defined(OS_CHROMEOS)
#include "ui/views/widget/desktop_aura/desktop_screen.h"
#endif
#if defined(OS_WIN)
#include "ui/base/win/scoped_ole_initializer.h"
#endif
int main(int argc, char** argv) {
#if defined(OS_WIN)
ui::ScopedOleInitializer ole_initializer_;
#endif
CommandLine::Init(argc, argv);
base::AtExitManager at_exit;
base::MessageLoopForUI message_loop;
base::i18n::InitializeICU();
base::FilePath pak_dir;
PathService::Get(base::DIR_MODULE, &pak_dir);
base::FilePath pak_file;
pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak"));
ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
gfx::GLSurface::InitializeOneOff();
// The ContextFactory must exist before any Compositors are created.
bool enable_pixel_output = true;
ui::InitializeContextFactoryForTests(enable_pixel_output);
aura::Env::CreateInstance();
ui::InitializeInputMethodForTesting();
{
views::DesktopTestViewsDelegate views_delegate;
views::corewm::WMState wm_state;
#if !defined(OS_CHROMEOS)
scoped_ptr<gfx::Screen> desktop_screen(views::CreateDesktopScreen());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE,
desktop_screen.get());
#endif
views::examples::ShowExamplesWindow(
views::examples::QUIT_ON_CLOSE,
NULL,
scoped_ptr<ScopedVector<views::examples::ExampleBase> >());
base::RunLoop().Run();
ui::ResourceBundle::CleanupSharedInstance();
}
ui::ShutdownInputMethod();
aura::Env::DeleteInstance();
return 0;
}
|