| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_TEST_ASH_TEST_BASE_H_ | 5 #ifndef ASH_TEST_ASH_TEST_BASE_H_ |
| 6 #define ASH_TEST_ASH_TEST_BASE_H_ | 6 #define ASH_TEST_ASH_TEST_BASE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "ui/views/test/test_views_delegate.h" |
| 13 | 14 |
| 14 namespace ash { | 15 namespace ash { |
| 15 namespace test { | 16 namespace test { |
| 16 | 17 |
| 18 class AshTestViewsDelegate : public views::TestViewsDelegate { |
| 19 public: |
| 20 // Overriden from TestViewsDelegate. |
| 21 virtual content::WebContents* CreateWebContents( |
| 22 content::BrowserContext* browser_context, |
| 23 content::SiteInstance* site_instance) OVERRIDE; |
| 24 }; |
| 25 |
| 17 class AshTestBase : public testing::Test { | 26 class AshTestBase : public testing::Test { |
| 18 public: | 27 public: |
| 19 AshTestBase(); | 28 AshTestBase(); |
| 20 virtual ~AshTestBase(); | 29 virtual ~AshTestBase(); |
| 21 | 30 |
| 22 MessageLoopForUI* message_loop() { return &message_loop_; } | 31 MessageLoopForUI* message_loop() { return &message_loop_; } |
| 23 | 32 |
| 24 // testing::Test: | 33 // testing::Test: |
| 25 virtual void SetUp() OVERRIDE; | 34 virtual void SetUp() OVERRIDE; |
| 26 virtual void TearDown() OVERRIDE; | 35 virtual void TearDown() OVERRIDE; |
| 27 | 36 |
| 28 // Change the primary monitor's configuration to use |bounds| | 37 // Change the primary monitor's configuration to use |bounds| |
| 29 // and |scale|. | 38 // and |scale|. |
| 30 void ChangeMonitorConfig(float scale, const gfx::Rect& bounds); | 39 void ChangeMonitorConfig(float scale, const gfx::Rect& bounds); |
| 31 | 40 |
| 32 protected: | 41 protected: |
| 33 void RunAllPendingInMessageLoop(); | 42 void RunAllPendingInMessageLoop(); |
| 34 | 43 |
| 35 private: | 44 private: |
| 36 MessageLoopForUI message_loop_; | 45 MessageLoopForUI message_loop_; |
| 37 | 46 |
| 38 DISALLOW_COPY_AND_ASSIGN(AshTestBase); | 47 DISALLOW_COPY_AND_ASSIGN(AshTestBase); |
| 39 }; | 48 }; |
| 40 | 49 |
| 41 } // namespace test | 50 } // namespace test |
| 42 } // namespace ash | 51 } // namespace ash |
| 43 | 52 |
| 44 #endif // ASH_TEST_ASH_TEST_BASE_H_ | 53 #endif // ASH_TEST_ASH_TEST_BASE_H_ |
| OLD | NEW |