Home | History | Annotate | Download | only in automation
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_
      6 #define CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_
      7 #pragma once
      8 
      9 #include "chrome/browser/automation/automation_tab_helper.h"
     10 #include "testing/gmock/include/gmock/gmock.h"
     11 
     12 class MockTabEventObserver : public TabEventObserver {
     13  public:
     14   MockTabEventObserver();
     15   // Convenience constructor for observing the |tab_helper| on creation.
     16   explicit MockTabEventObserver(AutomationTabHelper* tab_helper);
     17   virtual ~MockTabEventObserver();
     18 
     19   // Promote these to public for testing purposes.
     20   void StartObserving(AutomationTabHelper* tab_helper);
     21   void StopObserving(AutomationTabHelper* tab_helper);
     22 
     23   MOCK_METHOD1(OnFirstPendingLoad, void(TabContents* tab_contents));
     24   MOCK_METHOD1(OnNoMorePendingLoads, void(TabContents* tab_contents));
     25 
     26  private:
     27   DISALLOW_COPY_AND_ASSIGN(MockTabEventObserver);
     28 };
     29 
     30 #endif  // CHROME_BROWSER_AUTOMATION_MOCK_TAB_EVENT_OBSERVER_H_
     31