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

Unified Diff: ash/mus/test/ash_test_impl_mus.cc

Issue 2374893002: Adds AshTest (Closed)
Patch Set: real feedback Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ash/mus/test/ash_test_impl_mus.cc
diff --git a/ash/mus/test/ash_test_impl_mus.cc b/ash/mus/test/ash_test_impl_mus.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e530ebe245a1a932ea53ca172b7f4422e86b6a3b
--- /dev/null
+++ b/ash/mus/test/ash_test_impl_mus.cc
@@ -0,0 +1,86 @@
+// Copyright 2016 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 "ash/mus/test/ash_test_impl_mus.h"
+
+#include "ash/common/test/ash_test.h"
+#include "ash/mus/bridge/wm_window_mus.h"
+#include "base/memory/ptr_util.h"
+#include "services/ui/public/cpp/property_type_converters.h"
+#include "services/ui/public/cpp/window.h"
+#include "services/ui/public/cpp/window_property.h"
+#include "services/ui/public/interfaces/window_manager.mojom.h"
+
+namespace ash {
+namespace mus {
+namespace {
+
+// WmTestBase is abstract as TestBody() is pure virtual (the various TEST
+// macros have the implementation). In order to create WmTestBase we have to
+// subclass with an empty implementation of TestBody(). That's ok as the class
+// isn't used as a normal test here.
+class WmTestBaseImpl : public WmTestBase {
+ public:
+ WmTestBaseImpl() {}
+ ~WmTestBaseImpl() override {}
+
+ // WmTestBase:
+ void TestBody() override {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WmTestBaseImpl);
+};
+
+} // namespace
+
+AshTestImplMus::AshTestImplMus()
+ : wm_test_base_(base::MakeUnique<WmTestBaseImpl>()) {}
+
+AshTestImplMus::~AshTestImplMus() {}
+
+void AshTestImplMus::SetUp() {
+ wm_test_base_->SetUp();
+}
+
+void AshTestImplMus::TearDown() {
+ wm_test_base_->TearDown();
+}
+
+bool AshTestImplMus::SupportsMultipleDisplays() const {
+ return wm_test_base_->SupportsMultipleDisplays();
+}
+
+void AshTestImplMus::UpdateDisplay(const std::string& display_spec) {
+ wm_test_base_->UpdateDisplay(display_spec);
+}
+
+std::unique_ptr<WindowOwner> AshTestImplMus::CreateTestWindow(
+ const gfx::Rect& bounds_in_screen,
+ ui::wm::WindowType type,
+ int shell_window_id) {
+ WmWindowMus* window =
+ WmWindowMus::Get(wm_test_base_->CreateTestWindow(bounds_in_screen, type));
+ window->SetShellWindowId(shell_window_id);
+ return base::MakeUnique<WindowOwner>(window);
+}
+
+display::Display AshTestImplMus::GetSecondaryDisplay() {
+ return wm_test_base_->GetSecondaryDisplay();
+}
+
+bool AshTestImplMus::SetSecondaryDisplayPlacement(
+ display::DisplayPlacement::Position position,
+ int offset) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace mus
+
+// static
+std::unique_ptr<AshTestImpl> AshTestImpl::Create() {
+ return base::MakeUnique<mus::AshTestImplMus>();
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698