| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #include "ash/wm/ash_native_cursor_manager.h" | 4 #include "ash/wm/ash_native_cursor_manager.h" |
| 5 | 5 |
| 6 #include "ash/display/display_info.h" | 6 #include "ash/display/display_info.h" |
| 7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/test/cursor_manager_test_api.h" | 10 #include "ash/test/cursor_manager_test_api.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 class AshNativeCursorManagerTest : public test::AshTestBase { | 28 class AshNativeCursorManagerTest : public test::AshTestBase { |
| 29 public: | 29 public: |
| 30 AshNativeCursorManagerTest() {} | 30 AshNativeCursorManagerTest() {} |
| 31 virtual ~AshNativeCursorManagerTest() {} | 31 virtual ~AshNativeCursorManagerTest() {} |
| 32 | 32 |
| 33 virtual void SetUp() OVERRIDE { | 33 virtual void SetUp() OVERRIDE { |
| 34 gfx::GLSurface::InitializeOneOffForTests(); | 34 gfx::GLSurface::InitializeOneOffForTests(); |
| 35 | 35 |
| 36 ui::RegisterPathProvider(); | 36 ui::RegisterPathProvider(); |
| 37 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 37 ui::ResourceBundle::InitSharedInstanceWithLocale( |
| 38 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); |
| 38 base::FilePath resources_pack_path; | 39 base::FilePath resources_pack_path; |
| 39 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 40 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
| 40 resources_pack_path = | 41 resources_pack_path = |
| 41 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); | 42 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
| 42 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 43 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 43 resources_pack_path, ui::SCALE_FACTOR_NONE); | 44 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 44 | 45 |
| 45 test::AshTestBase::SetUp(); | 46 test::AshTestBase::SetUp(); |
| 46 } | 47 } |
| 47 }; | 48 }; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 display_manager->OnNativeDisplaysChanged(display_info_list); | 103 display_manager->OnNativeDisplaysChanged(display_info_list); |
| 103 | 104 |
| 104 MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10); | 105 MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10); |
| 105 EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor()); | 106 EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor()); |
| 106 | 107 |
| 107 MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10); | 108 MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10); |
| 108 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); | 109 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace ash | 112 } // namespace ash |
| OLD | NEW |