| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_ | 6 #define CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> |
| 10 |
| 9 #include "chrome/browser/automation/automation_tab_helper.h" | 11 #include "chrome/browser/automation/automation_tab_helper.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "ui/gfx/point.h" |
| 11 | 14 |
| 12 class MockTabEventObserver : public TabEventObserver { | 15 class MockTabEventObserver : public TabEventObserver { |
| 13 public: | 16 public: |
| 14 MockTabEventObserver(); | 17 MockTabEventObserver(); |
| 15 // Convenience constructor for observing the |tab_helper| on creation. | 18 // Convenience constructor for observing the |tab_helper| on creation. |
| 16 explicit MockTabEventObserver(AutomationTabHelper* tab_helper); | 19 explicit MockTabEventObserver(AutomationTabHelper* tab_helper); |
| 17 virtual ~MockTabEventObserver(); | 20 virtual ~MockTabEventObserver(); |
| 18 | 21 |
| 19 // Promote these to public for testing purposes. | 22 // Promote these to public for testing purposes. |
| 20 void StartObserving(AutomationTabHelper* tab_helper); | 23 void StartObserving(AutomationTabHelper* tab_helper); |
| 21 void StopObserving(AutomationTabHelper* tab_helper); | 24 void StopObserving(AutomationTabHelper* tab_helper); |
| 22 | 25 |
| 23 MOCK_METHOD1(OnFirstPendingLoad, void(content::WebContents* tab_contents)); | 26 MOCK_METHOD1(OnFirstPendingLoad, void(content::WebContents* tab_contents)); |
| 24 MOCK_METHOD1(OnNoMorePendingLoads, void(content::WebContents* tab_contents)); | 27 MOCK_METHOD1(OnNoMorePendingLoads, void(content::WebContents* tab_contents)); |
| 28 MOCK_METHOD1(OnWillProcessMouseEventAt, void(const gfx::Point& point)); |
| 29 MOCK_METHOD2(OnProcessMouseEventACK, |
| 30 void(bool success, const std::string& error_msg)); |
| 25 | 31 |
| 26 private: | 32 private: |
| 27 DISALLOW_COPY_AND_ASSIGN(MockTabEventObserver); | 33 DISALLOW_COPY_AND_ASSIGN(MockTabEventObserver); |
| 28 }; | 34 }; |
| 29 | 35 |
| 30 #endif // CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_ | 36 #endif // CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_ |
| OLD | NEW |