forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow_server_test_impl.h
49 lines (36 loc) · 1.62 KB
/
window_server_test_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// 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.
#ifndef SERVICES_WS_WINDOW_SERVER_TEST_IMPL_H_
#define SERVICES_WS_WINDOW_SERVER_TEST_IMPL_H_
#include "services/ws/public/mojom/window_server_test.mojom.h"
namespace ws {
class WindowService;
class WindowTree;
// Used to detect when a client (as identified by a name) has drawn at least
// once to screen.
class WindowServerTestImpl : public mojom::WindowServerTest {
public:
explicit WindowServerTestImpl(WindowService* server);
~WindowServerTestImpl() override;
private:
WindowTree* GetWindowTreeWithClientName(const std::string& name);
// Callback when a surface is activated. |desired_client_name| is the name of
// the client that was requested, |actual_client_name| is the name of the
// client that actually painted.
void OnSurfaceActivated(const std::string& desired_client_name,
EnsureClientHasDrawnWindowCallback cb,
const std::string& actual_client_name);
// Installs a callback that calls OnSurfaceActivated() the next time a client
// creates a compositor frame.
void InstallCallback(const std::string& name,
EnsureClientHasDrawnWindowCallback cb);
// mojom::WindowServerTest:
void EnsureClientHasDrawnWindow(
const std::string& client_name,
EnsureClientHasDrawnWindowCallback callback) override;
WindowService* window_service_;
DISALLOW_COPY_AND_ASSIGN(WindowServerTestImpl);
};
} // namespace ws
#endif // SERVICES_WS_WINDOW_SERVER_TEST_IMPL_H_