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

Unified Diff: content/shell/renderer/test_runner/mock_presentation_client.h

Issue 905823004: Added MockPresentationClient to use in layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/test_runner/mock_presentation_client.h
diff --git a/content/shell/renderer/test_runner/mock_presentation_client.h b/content/shell/renderer/test_runner/mock_presentation_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..074449154086be3928d9333a4aae5fb4f9b4bf35
--- /dev/null
+++ b/content/shell/renderer/test_runner/mock_presentation_client.h
@@ -0,0 +1,39 @@
+// Copyright 2015 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 CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_PRESENTATION_CLIENT_H_
+#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_PRESENTATION_CLIENT_H_
+
+#include "base/macros.h"
+#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationClient.h"
+
+namespace content {
+
+// A mock implementation of WebPresentationClient to be used in tests with
+// content shell.
+class MockPresentationClient : public blink::WebPresentationClient {
+ public:
+ explicit MockPresentationClient();
+ virtual ~MockPresentationClient();
+
+ void SetScreenAvailability(bool available);
+
+ private:
+ // From blink::WebPresentationClient.
+ // Passes the Blink-side delegate to the embedder.
+ virtual void setController(blink::WebPresentationController*);
+
+ // Called when the frame attaches the first event listener to or removes the
+ // last event listener from the |availablechange| event.
+ virtual void updateAvailableChangeWatched(bool watched);
+
+ blink::WebPresentationController* controller_;
+ bool screen_availability_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockPresentationClient);
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_PRESENTATION_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698