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

Side by Side Diff: content/shell/renderer/test_runner/mock_presentation_client.h

Issue 907893002: Retry to add MockPresentationClient to use in layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split Presentation API mock into per-frame and per-view objects Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_PRESENTATION_CLIENT_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_PRESENTATION_CLIENT_H_
7
8 #include "base/macros.h"
9 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio nClient.h"
10
11 namespace content {
12
13 class MockPresentationService;
14
15 // A mock implementation of WebPresentationClient to be used in tests with
16 // content shell. One instance exists per frame, owned by the WebFrameTestProxy.
17 // Must be registered with MockPresentationService to get the mock calls from
18 // the test page.
19 class MockPresentationClient : public blink::WebPresentationClient {
20 public:
21 explicit MockPresentationClient(MockPresentationService* service);
22 virtual ~MockPresentationClient();
23
24 // Used to imitate the screen availability change by the tests.
25 void SetScreenAvailability(bool available);
26
27 // Resets the client test state to the defaults for the next test.
28 void Reset();
29
30 // blink::WebPresentationClient implementation.
31 virtual void setController(blink::WebPresentationController* controller);
32 virtual void updateAvailableChangeWatched(bool watched);
33
34 private:
35 // The actual WebPresentationController implementation that's being tested.
36 // Lives within the same frame as the presentation client.
37 blink::WebPresentationController* controller_;
38
39 // The last known state of the screen availability. Defaults to false.
40 bool screen_availability_;
41
42 // The common mock service for all mock clients within the same RenderView.
43 // Used to register/unregister itself from.
44 MockPresentationService* service_;
45
46 DISALLOW_COPY_AND_ASSIGN(MockPresentationClient);
47 };
48
49 } // namespace content
50
51 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_PRESENTATION_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698