0

Converts mash_wm_apptests to unit tests

BUG=594733
TEST=test only change
R=dpranke@chromium.org, erg@chromium.org

Review URL: https://codereview.chromium.org/1822133002

Cr-Commit-Position: refs/heads/master@{#382652}
This commit is contained in:
sky
2016-03-22 12:45:59 -07:00
committed by Commit bot
parent 51884f7757
commit 48ad0960ce
8 changed files with 36 additions and 74 deletions

@ -589,7 +589,7 @@ group("mojo_apptests") {
if (is_win || is_linux) {
deps += [
"//components/resource_provider:resource_provider_unittests",
"//mash/wm:tests",
"//mash:mash_unittests",
"//media/mojo/services:tests",
"//ui/views/mus:tests",
]

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//mojo/public/mojo_application_manifest.gni")
import("//testing/test.gni")
# Target that builders build.
@ -9,7 +10,7 @@ group("all") {
testonly = true
deps = [
":tests",
":mash_unittests",
"//components/leveldb",
"//mash/example",
"//mash/init",
@ -20,22 +21,23 @@ group("all") {
]
}
group("tests") {
testonly = true
deps = [
":mash_unittests",
"//mash/wm:tests",
]
}
test("mash_unittests") {
deps = [
"//base",
"//base/test:run_all_unittests",
"//base/test:test_config",
"//base/test:test_support",
"//mash/wm:unittests",
"//mojo/platform_handle:platform_handle_impl",
"//mojo/shell/background:main",
"//mojo/shell/public/cpp/test:run_all_shelltests",
]
data_deps = [
":unittests_manifest",
]
}
mojo_application_manifest("unittests_manifest") {
type = "exe"
application_name = "mash_unittests"
source = "unittests_manifest.json"
}

@ -0,0 +1,5 @@
{
"name": "exe:mash_unittests",
"display_name": "Mash Unittests",
"capabilities": { "*": ["*"] }
}

@ -8,13 +8,6 @@ import("//mojo/public/mojo_application_manifest.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//tools/grit/repack.gni")
group("tests") {
testonly = true
deps = [
":apptests",
]
}
source_set("lib") {
sources = [
"accelerator_registrar_impl.cc",
@ -140,50 +133,14 @@ repack("resources") {
]
}
mojo_native_application("apptests") {
output_name = "mash_wm_apptests"
testonly = true
sources = [
"accelerator_registrar_apptest.cc",
"window_manager_apptest.cc",
]
deps = [
"//base",
"//base/test:test_config",
"//components/mus/public/cpp",
"//components/mus/public/interfaces",
"//mojo/common:common_base",
"//mojo/converters/geometry",
"//mojo/converters/input_events",
"//mojo/shell/public/cpp:sources",
"//mojo/shell/public/cpp:test_support",
"//ui/mojo/geometry:interfaces",
"//ui/mojo/geometry:util",
]
data_deps = [
":apptest_manifest",
":wm",
]
if (use_x11) {
deps += [ "//tools/xdisplaycheck" ]
}
}
mojo_application_manifest("apptest_manifest") {
application_name = "mash_wm_apptests"
source = "apptest_manifest.json"
}
source_set("unittests") {
testonly = true
sources = [
"accelerator_registrar_unittest.cc",
"frame/move_loop_unittest.cc",
"layout_manager_unittest.cc",
"window_manager_unittest.cc",
]
deps = [
@ -192,12 +149,14 @@ source_set("unittests") {
"//base/test:test_config",
"//components/mus/public/cpp",
"//components/mus/public/cpp/tests:unittest_support",
"//components/mus/public/interfaces",
"//mojo/converters/geometry",
"//mojo/converters/input_events",
"//mojo/edk/system",
"//mojo/gles2",
"//mojo/platform_handle",
"//mojo/public/cpp/system",
"//mojo/shell/public/cpp:shell_test_support",
"//testing/gtest",
"//ui/base",
"//ui/events",

@ -11,7 +11,7 @@
#include "components/mus/public/cpp/window.h"
#include "components/mus/public/interfaces/accelerator_registrar.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/shell/public/cpp/application_test_base.h"
#include "mojo/shell/public/cpp/shell_test.h"
using mus::mojom::AcceleratorHandler;
using mus::mojom::AcceleratorHandlerPtr;
@ -65,9 +65,9 @@ class TestAcceleratorHandler : public AcceleratorHandler {
DISALLOW_COPY_AND_ASSIGN(TestAcceleratorHandler);
};
class AcceleratorRegistrarTest : public mojo::test::ApplicationTestBase {
class AcceleratorRegistrarTest : public mojo::test::ShellTest {
public:
AcceleratorRegistrarTest() {}
AcceleratorRegistrarTest() : mojo::test::ShellTest("exe:mash_unittests") {}
~AcceleratorRegistrarTest() override {}
protected:

@ -1,5 +0,0 @@
{
"name": "mojo:mash_wm_apptests",
"display_name": "Desktop Window Manager Apptests",
"capabilities": { "*": ["*"] }
}

@ -11,7 +11,7 @@
#include "components/mus/public/cpp/window_tree_connection.h"
#include "components/mus/public/cpp/window_tree_delegate.h"
#include "components/mus/public/interfaces/window_tree.mojom.h"
#include "mojo/shell/public/cpp/application_test_base.h"
#include "mojo/shell/public/cpp/shell_test.h"
namespace mash {
namespace wm {
@ -29,13 +29,20 @@ class WindowTreeDelegateImpl : public mus::WindowTreeDelegate {
DISALLOW_COPY_AND_ASSIGN(WindowTreeDelegateImpl);
};
using WindowManagerAppTest = mojo::test::ApplicationTestBase;
class WindowManagerTest : public mojo::test::ShellTest {
public:
WindowManagerTest() : mojo::test::ShellTest("exe:mash_unittests") {}
~WindowManagerTest() override {}
private:
DISALLOW_COPY_AND_ASSIGN(WindowManagerTest);
};
void OnEmbed(bool success) {
ASSERT_TRUE(success);
}
TEST_F(WindowManagerAppTest, OpenWindow) {
TEST_F(WindowManagerTest, OpenWindow) {
WindowTreeDelegateImpl window_tree_delegate;
// Bring up the the desktop_wm.

@ -34,12 +34,6 @@ tests = [
# TODO(msw): Get these tests passing on Android too. http://crbug.com/486220
if config.target_os != config.OS_ANDROID:
tests += [
{
'test': 'mojo:mash_wm_apptests',
'type': 'gtest_isolated',
'args': ['--use-x11-test-config',
'--override-use-gl-with-osmesa-for-tests']
},
{
'test': 'mojo:media_apptests',
'type': 'gtest_isolated',