| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "ui/views/test/test_views_delegate.h" | 14 #include "ui/views/test/test_views_delegate.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 namespace internal { | 17 namespace internal { |
| 18 class MultiDisplayManager; | 18 class DisplayManager; |
| 19 } // internal | 19 } // internal |
| 20 | 20 |
| 21 namespace test { | 21 namespace test { |
| 22 | 22 |
| 23 class TestShellDelegate; | 23 class TestShellDelegate; |
| 24 | 24 |
| 25 class AshTestViewsDelegate : public views::TestViewsDelegate { | 25 class AshTestViewsDelegate : public views::TestViewsDelegate { |
| 26 public: | 26 public: |
| 27 // Overriden from TestViewsDelegate. | 27 // Overriden from TestViewsDelegate. |
| 28 virtual content::WebContents* CreateWebContents( | 28 virtual content::WebContents* CreateWebContents( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // testing::Test: | 40 // testing::Test: |
| 41 virtual void SetUp() OVERRIDE; | 41 virtual void SetUp() OVERRIDE; |
| 42 virtual void TearDown() OVERRIDE; | 42 virtual void TearDown() OVERRIDE; |
| 43 | 43 |
| 44 // Change the primary display's configuration to use |bounds| | 44 // Change the primary display's configuration to use |bounds| |
| 45 // and |scale|. | 45 // and |scale|. |
| 46 void ChangeDisplayConfig(float scale, const gfx::Rect& bounds); | 46 void ChangeDisplayConfig(float scale, const gfx::Rect& bounds); |
| 47 | 47 |
| 48 // Update the display configuration as given in |display_specs|. | 48 // Update the display configuration as given in |display_specs|. |
| 49 // See ash::test::MultiDisplayManagerTestApi::UpdateDisplay for more details. | 49 // See ash::test::DisplayManagerTestApi::UpdateDisplay for more details. |
| 50 void UpdateDisplay(const std::string& display_specs); | 50 void UpdateDisplay(const std::string& display_specs); |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 void RunAllPendingInMessageLoop(); | 53 void RunAllPendingInMessageLoop(); |
| 54 | 54 |
| 55 // Utility methods to emulate user logged in or not and | 55 // Utility methods to emulate user logged in or not and |
| 56 // session started or not cases. | 56 // session started or not cases. |
| 57 void SetSessionStarted(bool session_started); | 57 void SetSessionStarted(bool session_started); |
| 58 void SetUserLoggedIn(bool user_logged_in); | 58 void SetUserLoggedIn(bool user_logged_in); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 MessageLoopForUI message_loop_; | 61 MessageLoopForUI message_loop_; |
| 62 | 62 |
| 63 TestShellDelegate* test_shell_delegate_; | 63 TestShellDelegate* test_shell_delegate_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(AshTestBase); | 65 DISALLOW_COPY_AND_ASSIGN(AshTestBase); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace test | 68 } // namespace test |
| 69 } // namespace ash | 69 } // namespace ash |
| 70 | 70 |
| 71 #endif // ASH_TEST_ASH_TEST_BASE_H_ | 71 #endif // ASH_TEST_ASH_TEST_BASE_H_ |
| OLD | NEW |