Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 BLIMP_TEST_TEST_CLIENT_H_ | |
| 6 #define BLIMP_TEST_TEST_CLIENT_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "blimp/client/feature/ime_feature.h" | |
| 11 #include "blimp/client/feature/navigation_feature.h" | |
| 12 #include "blimp/client/feature/render_widget_feature.h" | |
| 13 #include "blimp/client/feature/tab_control_feature.h" | |
| 14 #include "blimp/client/session/blimp_client_session.h" | |
| 15 #include "testing/gmock/include/gmock/gmock.h" | |
| 16 | |
| 17 class GURL; | |
| 18 class SkBitmap; | |
| 19 | |
| 20 namespace blimp { | |
| 21 | |
| 22 class TestClientSession : public client::BlimpClientSession { | |
| 23 public: | |
| 24 TestClientSession(); | |
| 25 ~TestClientSession() override; | |
| 26 | |
| 27 private: | |
| 28 DISALLOW_COPY_AND_ASSIGN(TestClientSession); | |
| 29 }; | |
| 30 | |
| 31 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.
| |
| 32 : public client::NavigationFeature::NavigationFeatureDelegate { | |
| 33 public: | |
| 34 MockNavigationFeatureDelegate(); | |
| 35 ~MockNavigationFeatureDelegate() override; | |
| 36 | |
| 37 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.
| |
| 38 MOCK_METHOD2(OnFaviconChanged, void(int tab_id, const SkBitmap& favicon)); | |
| 39 MOCK_METHOD2(OnTitleChanged, void(int tab_id, const std::string& title)); | |
| 40 MOCK_METHOD2(OnLoadingChanged, void(int tab_id, bool loading)); | |
| 41 MOCK_METHOD2(OnPageLoadStatusUpdate, void(int tab_id, bool completed)); | |
| 42 }; | |
| 43 | |
| 44 class MockRenderWidgetFeatureDelegate | |
| 45 : public client::RenderWidgetFeature::RenderWidgetFeatureDelegate { | |
| 46 public: | |
| 47 MockRenderWidgetFeatureDelegate(); | |
| 48 ~MockRenderWidgetFeatureDelegate() override; | |
| 49 | |
| 50 MOCK_METHOD1(OnRenderWidgetCreated, void(int render_widget_id)); | |
| 51 MOCK_METHOD1(OnRenderWidgetInitialized, void(int render_widget_id)); | |
| 52 MOCK_METHOD1(OnRenderWidgetDeleted, void(int render_widget_id)); | |
| 53 MOCK_METHOD2(OnCompositorMessageReceivedPtr, | |
|
Kevin M
2016/05/02 21:32:40
nit: MockableOnCompositorMessageReceived for consi
haibinlu
2016/05/03 19:32:43
Done.
| |
| 54 void(int render_widget_id, | |
| 55 cc::proto::CompositorMessage* message)); | |
| 56 | |
| 57 void OnCompositorMessageReceived( | |
| 58 int render_widget_id, | |
| 59 std::unique_ptr<cc::proto::CompositorMessage> message) override; | |
| 60 }; | |
| 61 | |
| 62 class MockImeFeatureDelegate : public client::ImeFeature::Delegate { | |
| 63 public: | |
| 64 MockImeFeatureDelegate(); | |
| 65 ~MockImeFeatureDelegate() override; | |
| 66 | |
| 67 MOCK_METHOD2(OnShowImeRequested, | |
| 68 void(ui::TextInputType input_type, const std::string& text)); | |
| 69 MOCK_METHOD0(OnHideImeRequested, void()); | |
| 70 }; | |
| 71 | |
| 72 } // namespace blimp | |
| 73 | |
| 74 #endif // BLIMP_TEST_TEST_CLIENT_H_ | |
| OLD | NEW |