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

Unified Diff: blimp/test/test_client.h

Issue 1929723002: [Blimp] Adds blimp engine browser test framework and LoadUrl test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addresses comments and rebases Created 4 years, 8 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: blimp/test/test_client.h
diff --git a/blimp/test/test_client.h b/blimp/test/test_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..a8c5d085392585cec6b2830b5e7584e3597ff46f
--- /dev/null
+++ b/blimp/test/test_client.h
@@ -0,0 +1,74 @@
+// 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 BLIMP_TEST_TEST_CLIENT_H_
+#define BLIMP_TEST_TEST_CLIENT_H_
+
+#include <string>
+
+#include "blimp/client/feature/ime_feature.h"
+#include "blimp/client/feature/navigation_feature.h"
+#include "blimp/client/feature/render_widget_feature.h"
+#include "blimp/client/feature/tab_control_feature.h"
+#include "blimp/client/session/blimp_client_session.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+class GURL;
+class SkBitmap;
+
+namespace blimp {
+
+class TestClientSession : public client::BlimpClientSession {
+ public:
+ TestClientSession();
+ ~TestClientSession() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestClientSession);
+};
+
+class MockNavigationFeatureDelegate
Kevin M 2016/05/02 21:32:40 Put mock class definitions in .h files side-by-sid
haibinlu 2016/05/03 19:32:43 Done.
+ : public client::NavigationFeature::NavigationFeatureDelegate {
+ public:
+ MockNavigationFeatureDelegate();
+ ~MockNavigationFeatureDelegate() override;
+
+ MOCK_METHOD2(OnUrlChanged, void(int tab_id, const GURL& url));
Kevin M 2016/05/02 21:32:40 nit: Mocked parameter names aren't needed
haibinlu 2016/05/03 19:32:43 much easier to read with the parameter names.
+ MOCK_METHOD2(OnFaviconChanged, void(int tab_id, const SkBitmap& favicon));
+ MOCK_METHOD2(OnTitleChanged, void(int tab_id, const std::string& title));
+ MOCK_METHOD2(OnLoadingChanged, void(int tab_id, bool loading));
+ MOCK_METHOD2(OnPageLoadStatusUpdate, void(int tab_id, bool completed));
+};
+
+class MockRenderWidgetFeatureDelegate
+ : public client::RenderWidgetFeature::RenderWidgetFeatureDelegate {
+ public:
+ MockRenderWidgetFeatureDelegate();
+ ~MockRenderWidgetFeatureDelegate() override;
+
+ MOCK_METHOD1(OnRenderWidgetCreated, void(int render_widget_id));
+ MOCK_METHOD1(OnRenderWidgetInitialized, void(int render_widget_id));
+ MOCK_METHOD1(OnRenderWidgetDeleted, void(int render_widget_id));
+ MOCK_METHOD2(OnCompositorMessageReceivedPtr,
Kevin M 2016/05/02 21:32:40 nit: MockableOnCompositorMessageReceived for consi
haibinlu 2016/05/03 19:32:43 Done.
+ void(int render_widget_id,
+ cc::proto::CompositorMessage* message));
+
+ void OnCompositorMessageReceived(
+ int render_widget_id,
+ std::unique_ptr<cc::proto::CompositorMessage> message) override;
+};
+
+class MockImeFeatureDelegate : public client::ImeFeature::Delegate {
+ public:
+ MockImeFeatureDelegate();
+ ~MockImeFeatureDelegate() override;
+
+ MOCK_METHOD2(OnShowImeRequested,
+ void(ui::TextInputType input_type, const std::string& text));
+ MOCK_METHOD0(OnHideImeRequested, void());
+};
+
+} // namespace blimp
+
+#endif // BLIMP_TEST_TEST_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698