summaryrefslogtreecommitdiffstats
path: root/ui/ozone
diff options
context:
space:
mode:
authorspang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 01:52:37 +0000
committerspang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 01:52:37 +0000
commitf1885af3e4bc5cbed1ecd0a284e6e131cb092bc4 (patch)
tree2d3de4c14b69fa2b323306eac8a374c1464f5a3b /ui/ozone
parentf58af089bf7603584fae284907313415a42ccf05 (diff)
downloadchromium_src-f1885af3e4bc5cbed1ecd0a284e6e131cb092bc4.zip
chromium_src-f1885af3e4bc5cbed1ecd0a284e6e131cb092bc4.tar.gz
chromium_src-f1885af3e4bc5cbed1ecd0a284e6e131cb092bc4.tar.bz2
ozone: Add ozone_unittests target
Move all of our unittests from ui_unittests to ozone_unittests. BUG=none TEST=ozone_unittests Review URL: https://codereview.chromium.org/304633005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/ozone')
-rw-r--r--ui/ozone/ozone.gyp17
-rw-r--r--ui/ozone/ozone_unittests.gypi30
-rw-r--r--ui/ozone/platform/dri/dri.gypi34
-rw-r--r--ui/ozone/platform/dri/dri_surface_factory_unittest.cc3
-rw-r--r--ui/ozone/run_all_unittests.cc45
5 files changed, 98 insertions, 31 deletions
diff --git a/ui/ozone/ozone.gyp b/ui/ozone/ozone.gyp
index ca937bc..3bd833f 100644
--- a/ui/ozone/ozone.gyp
+++ b/ui/ozone/ozone.gyp
@@ -8,8 +8,10 @@
'external_ozone_platforms': [],
'external_ozone_platform_files': [],
'external_ozone_platform_deps': [],
+ 'external_ozone_platform_unittest_deps': [],
'internal_ozone_platforms': [],
'internal_ozone_platform_deps': [],
+ 'internal_ozone_platform_unittest_deps': [],
},
'targets': [
{
@@ -85,6 +87,21 @@
}],
]
},
+ {
+ 'target_name': 'ozone_unittests',
+ 'type': '<(gtest_target_type)',
+ 'sources': [
+ 'run_all_unittests.cc',
+ ],
+ 'dependencies': [
+ 'ozone',
+ '../../base/base.gyp:base',
+ '../../base/base.gyp:test_support_base',
+ '../../testing/gtest.gyp:gtest',
+ '<@(external_ozone_platform_unittest_deps)',
+ '<@(internal_ozone_platform_unittest_deps)',
+ ],
+ },
],
'conditions': [
['<(ozone_platform_caca) == 1', {
diff --git a/ui/ozone/ozone_unittests.gypi b/ui/ozone/ozone_unittests.gypi
deleted file mode 100644
index b57f47e..0000000
--- a/ui/ozone/ozone_unittests.gypi
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2014 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.
-
-{
- 'sources': [
- 'platform/dri/dri_surface_factory_unittest.cc',
- 'platform/dri/dri_surface_unittest.cc',
- 'platform/dri/hardware_display_controller_unittest.cc',
- 'platform/dri/screen_manager_unittest.cc',
- 'platform/dri/test/mock_dri_surface.cc',
- 'platform/dri/test/mock_dri_surface.h',
- 'platform/dri/test/mock_dri_wrapper.cc',
- 'platform/dri/test/mock_dri_wrapper.h',
- 'platform/dri/test/mock_surface_generator.cc',
- 'platform/dri/test/mock_surface_generator.h',
- ],
- 'conditions': [
- ['ozone_platform_dri == 1', {
- 'dependencies': [
- '../build/linux/system.gyp:dridrm',
- '../ui/ozone/ozone.gyp:ozone',
- ],
- }, {
- 'sources/': [
- ['exclude', '^platform/dri/'],
- ],
- }],
- ],
-}
diff --git a/ui/ozone/platform/dri/dri.gypi b/ui/ozone/platform/dri/dri.gypi
index 2bbcd47..a6c1744 100644
--- a/ui/ozone/platform/dri/dri.gypi
+++ b/ui/ozone/platform/dri/dri.gypi
@@ -7,6 +7,9 @@
'internal_ozone_platform_deps': [
'ozone_platform_dri',
],
+ 'internal_ozone_platform_unittest_deps': [
+ 'ozone_platform_dri_unittests',
+ ],
'internal_ozone_platforms': [
'dri',
],
@@ -26,6 +29,7 @@
'../events/ozone/events_ozone.gyp:events_ozone_evdev',
'../gfx/gfx.gyp:gfx',
'../gfx/gfx.gyp:gfx_geometry',
+ '../gfx/ozone/gfx_ozone.gyp:gfx_ozone',
],
'defines': [
'OZONE_IMPLEMENTATION',
@@ -60,5 +64,35 @@
'scanout_surface.h',
],
},
+ {
+ 'target_name': 'ozone_platform_dri_unittests',
+ 'type': 'none',
+ 'dependencies': [
+ '../../build/linux/system.gyp:dridrm',
+ '../../skia/skia.gyp:skia',
+ '../gfx/gfx.gyp:gfx_geometry',
+ '../gfx/ozone/gfx_ozone.gyp:gfx_ozone',
+ ],
+ 'export_dependent_settings': [
+ '../../build/linux/system.gyp:dridrm',
+ '../../skia/skia.gyp:skia',
+ '../gfx/gfx.gyp:gfx_geometry',
+ '../gfx/ozone/gfx_ozone.gyp:gfx_ozone',
+ ],
+ 'direct_dependent_settings': {
+ 'sources': [
+ 'dri_surface_factory_unittest.cc',
+ 'dri_surface_unittest.cc',
+ 'hardware_display_controller_unittest.cc',
+ 'screen_manager_unittest.cc',
+ 'test/mock_dri_surface.cc',
+ 'test/mock_dri_surface.h',
+ 'test/mock_dri_wrapper.cc',
+ 'test/mock_dri_wrapper.h',
+ 'test/mock_surface_generator.cc',
+ 'test/mock_surface_generator.h',
+ ],
+ },
+ },
],
}
diff --git a/ui/ozone/platform/dri/dri_surface_factory_unittest.cc b/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
index 4cdd1bf..4b0e12a 100644
--- a/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
+++ b/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
@@ -9,6 +9,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "third_party/skia/include/core/SkImageInfo.h"
#include "ui/gfx/ozone/surface_factory_ozone.h"
#include "ui/gfx/ozone/surface_ozone_canvas.h"
#include "ui/ozone/platform/dri/dri_buffer.h"
@@ -171,7 +172,7 @@ TEST_F(DriSurfaceFactoryTest, SetCursorImage) {
SkBitmap image;
SkImageInfo info = SkImageInfo::Make(
- 6, 4, kPMColor_SkColorType, kPremul_SkAlphaType);
+ 6, 4, kN32_SkColorType, kPremul_SkAlphaType);
image.allocPixels(info);
image.eraseColor(SK_ColorWHITE);
diff --git a/ui/ozone/run_all_unittests.cc b/ui/ozone/run_all_unittests.cc
new file mode 100644
index 0000000..3227099
--- /dev/null
+++ b/ui/ozone/run_all_unittests.cc
@@ -0,0 +1,45 @@
+// Copyright 2014 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/bind.h"
+#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_suite.h"
+#include "build/build_config.h"
+
+namespace {
+
+class OzoneTestSuite : public base::TestSuite {
+ public:
+ OzoneTestSuite(int argc, char** argv);
+
+ protected:
+ // base::TestSuite:
+ virtual void Initialize() OVERRIDE;
+ virtual void Shutdown() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OzoneTestSuite);
+};
+
+OzoneTestSuite::OzoneTestSuite(int argc, char** argv)
+ : base::TestSuite(argc, argv) {}
+
+void OzoneTestSuite::Initialize() {
+ base::TestSuite::Initialize();
+}
+
+void OzoneTestSuite::Shutdown() {
+ base::TestSuite::Shutdown();
+}
+
+} // namespace
+
+int main(int argc, char** argv) {
+ OzoneTestSuite test_suite(argc, argv);
+
+ return base::LaunchUnitTests(argc,
+ argv,
+ base::Bind(&OzoneTestSuite::Run,
+ base::Unretained(&test_suite)));
+}