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

Unified Diff: ash/login/mock_lock_screen_client.cc

Issue 2894193002: cros: Pull TestLockScreenClient into a separate MockLockScreenClient file. (Closed)
Patch Set: Rebase (remove parent dep) Created 3 years, 7 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
« no previous file with comments | « ash/login/mock_lock_screen_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/login/mock_lock_screen_client.cc
diff --git a/ash/login/mock_lock_screen_client.cc b/ash/login/mock_lock_screen_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..364f90cd6c64223f64ebaf4d77b21cb33a6c1715
--- /dev/null
+++ b/ash/login/mock_lock_screen_client.cc
@@ -0,0 +1,29 @@
+// Copyright 2017 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/login/mock_lock_screen_client.h"
+
+#include "ash/login/lock_screen_controller.h"
+#include "ash/shell.h"
+
+namespace ash {
+
+MockLockScreenClient::MockLockScreenClient() : binding_(this) {}
+
+MockLockScreenClient::~MockLockScreenClient() = default;
+
+mojom::LockScreenClientPtr MockLockScreenClient::CreateInterfacePtrAndBind() {
+ return binding_.CreateInterfacePtrAndBind();
+}
+
+std::unique_ptr<MockLockScreenClient> BindMockLockScreenClient() {
+ LockScreenController* lock_screen_controller =
+ Shell::Get()->lock_screen_controller();
+ auto lock_screen_client = base::MakeUnique<MockLockScreenClient>();
+ lock_screen_controller->SetClient(
+ lock_screen_client->CreateInterfacePtrAndBind());
+ return lock_screen_client;
+}
+
+} // namespace ash
« no previous file with comments | « ash/login/mock_lock_screen_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698