Home | History | Annotate | Download | only in frame
      1 // Copyright 2013 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_UI_VIEWS_FRAME_TEST_WITH_BROWSER_VIEW_H_
      6 #define CHROME_BROWSER_UI_VIEWS_FRAME_TEST_WITH_BROWSER_VIEW_H_
      7 
      8 #include "base/memory/scoped_ptr.h"
      9 #include "chrome/test/base/browser_with_test_window_test.h"
     10 
     11 namespace chrome {
     12 class TestingIOThreadState;
     13 }
     14 
     15 namespace predictors {
     16 class PredictorDatabase;
     17 }
     18 
     19 class BrowserView;
     20 class ScopedTestingLocalState;
     21 
     22 // Base class for BrowserView based unit tests. TestWithBrowserView creates
     23 // a Browser with a valid BrowserView and BrowserFrame with as little else as
     24 // possible.
     25 class TestWithBrowserView : public BrowserWithTestWindowTest {
     26  public:
     27   TestWithBrowserView();
     28   TestWithBrowserView(Browser::Type browser_type,
     29                       chrome::HostDesktopType host_desktop_type,
     30                       bool hosted_app);
     31   virtual ~TestWithBrowserView();
     32 
     33   // BrowserWithTestWindowTest overrides:
     34   virtual void SetUp() OVERRIDE;
     35   virtual void TearDown() OVERRIDE;
     36   virtual TestingProfile* CreateProfile() OVERRIDE;
     37   virtual BrowserWindow* CreateBrowserWindow() OVERRIDE;
     38 
     39   BrowserView* browser_view() { return browser_view_; }
     40 
     41  private:
     42   BrowserView* browser_view_;  // Not owned.
     43   scoped_ptr<ScopedTestingLocalState> local_state_;
     44   scoped_ptr<predictors::PredictorDatabase> predictor_db_;
     45   scoped_ptr<chrome::TestingIOThreadState> testing_io_thread_state_;
     46 
     47   DISALLOW_COPY_AND_ASSIGN(TestWithBrowserView);
     48 };
     49 
     50 #endif  // CHROME_BROWSER_UI_VIEWS_FRAME_TEST_WITH_BROWSER_VIEW_H_
     51