| OLD | NEW |
| (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 // Associated with the same frame as this 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_ | |
| OLD | NEW |