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

Side by Side Diff: ui/views/test/run_all_unittests.cc

Issue 1231763002: Adds a perf test for initializing and painting a views::LabelButton Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: various tweaks Created 5 years, 5 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
« no previous file with comments | « ui/views/test/run_all_perftests.cc ('k') | ui/views/test/views_test_suite.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/basictypes.h"
6 #include "base/bind.h" 5 #include "base/bind.h"
7 #include "base/compiler_specific.h"
8 #include "base/path_service.h"
9 #include "base/test/launcher/unit_test_launcher.h" 6 #include "base/test/launcher/unit_test_launcher.h"
10 #include "base/test/test_suite.h" 7 #include "base/test/test_suite.h"
11 #include "testing/gtest/include/gtest/gtest.h" 8 #include "ui/views/test/views_test_suite.h"
12 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/base/ui_base_paths.h"
14 #include "ui/gl/gl_surface.h"
15 9
16 class ViewTestSuite : public base::TestSuite { 10 class ViewTestSuite : public base::TestSuite {
17 public: 11 public:
18 ViewTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} 12 ViewTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
19 13
20 protected: 14 protected:
21 void Initialize() override { 15 void Initialize() override {
22 base::TestSuite::Initialize(); 16 base::TestSuite::Initialize();
23 gfx::GLSurface::InitializeOneOffForTests(); 17 test::InitializeViewsTestSuite();
24 ui::RegisterPathProvider();
25
26 base::FilePath ui_test_pak_path;
27 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
28 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
29 } 18 }
30 19
31 void Shutdown() override { 20 void Shutdown() override {
32 ui::ResourceBundle::CleanupSharedInstance(); 21 test::ShutdownViewsTestSuite();
33 base::TestSuite::Shutdown(); 22 base::TestSuite::Shutdown();
34 } 23 }
35 24
36 private: 25 private:
37 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite); 26 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite);
38 }; 27 };
39 28
40 int main(int argc, char** argv) { 29 int main(int argc, char** argv) {
41 ViewTestSuite test_suite(argc, argv); 30 ViewTestSuite test_suite(argc, argv);
42 31
43 return base::LaunchUnitTests( 32 return base::LaunchUnitTests(
44 argc, argv, base::Bind(&ViewTestSuite::Run, 33 argc, argv,
45 base::Unretained(&test_suite))); 34 base::Bind(&ViewTestSuite::Run, base::Unretained(&test_suite)));
46 } 35 }
OLDNEW
« no previous file with comments | « ui/views/test/run_all_perftests.cc ('k') | ui/views/test/views_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698