Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: ash/content/display/screen_orientation_controller_chromeos_unittest.cc

Issue 2314853003: Move ash::DisplayManager switches to ui::display (Closed)
Patch Set: rebased again Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/wm/window_cycle_list.cc ('k') | ash/dip_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ash/display/screen_orientation_controller_chromeos.h" 5 #include "ash/display/screen_orientation_controller_chromeos.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 11 matching lines...) Expand all
22 #include "ash/test/test_system_tray_delegate.h" 22 #include "ash/test/test_system_tray_delegate.h"
23 #include "base/command_line.h" 23 #include "base/command_line.h"
24 #include "chromeos/accelerometer/accelerometer_reader.h" 24 #include "chromeos/accelerometer/accelerometer_reader.h"
25 #include "chromeos/accelerometer/accelerometer_types.h" 25 #include "chromeos/accelerometer/accelerometer_types.h"
26 #include "content/public/browser/browser_context.h" 26 #include "content/public/browser/browser_context.h"
27 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
28 #include "content/public/test/test_browser_context.h" 28 #include "content/public/test/test_browser_context.h"
29 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree nOrientationLockType.h" 29 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree nOrientationLockType.h"
30 #include "ui/aura/window.h" 30 #include "ui/aura/window.h"
31 #include "ui/display/display.h" 31 #include "ui/display/display.h"
32 #include "ui/display/display_switches.h"
32 #include "ui/display/manager/managed_display_info.h" 33 #include "ui/display/manager/managed_display_info.h"
33 #include "ui/message_center/message_center.h" 34 #include "ui/message_center/message_center.h"
34 #include "ui/views/test/webview_test_helper.h" 35 #include "ui/views/test/webview_test_helper.h"
35 #include "ui/views/view.h" 36 #include "ui/views/view.h"
36 #include "ui/views/views_delegate.h" 37 #include "ui/views/views_delegate.h"
37 #include "ui/wm/public/activation_client.h" 38 #include "ui/wm/public/activation_client.h"
38 39
39 namespace ash { 40 namespace ash {
40 41
41 namespace { 42 namespace {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 152
152 content::WebContents* 153 content::WebContents*
153 ScreenOrientationControllerTest::CreateSecondaryWebContents() { 154 ScreenOrientationControllerTest::CreateSecondaryWebContents() {
154 secondary_browser_context_.reset(new content::TestBrowserContext()); 155 secondary_browser_context_.reset(new content::TestBrowserContext());
155 return views::ViewsDelegate::GetInstance()->CreateWebContents( 156 return views::ViewsDelegate::GetInstance()->CreateWebContents(
156 secondary_browser_context_.get(), nullptr); 157 secondary_browser_context_.get(), nullptr);
157 } 158 }
158 159
159 void ScreenOrientationControllerTest::SetUp() { 160 void ScreenOrientationControllerTest::SetUp() {
160 base::CommandLine::ForCurrentProcess()->AppendSwitch( 161 base::CommandLine::ForCurrentProcess()->AppendSwitch(
161 switches::kAshUseFirstDisplayAsInternal); 162 ::switches::kUseFirstDisplayAsInternal);
162 base::CommandLine::ForCurrentProcess()->AppendSwitch( 163 base::CommandLine::ForCurrentProcess()->AppendSwitch(
163 switches::kAshEnableTouchViewTesting); 164 switches::kAshEnableTouchViewTesting);
164 test::AshTestBase::SetUp(); 165 test::AshTestBase::SetUp();
165 } 166 }
166 167
167 // Tests that a content::WebContents can lock rotation. 168 // Tests that a content::WebContents can lock rotation.
168 TEST_F(ScreenOrientationControllerTest, LockOrientation) { 169 TEST_F(ScreenOrientationControllerTest, LockOrientation) {
169 std::unique_ptr<content::WebContents> content(CreateWebContents()); 170 std::unique_ptr<content::WebContents> content(CreateWebContents());
170 std::unique_ptr<aura::Window> focus_window(CreateTestWindowInShellWithId(0)); 171 std::unique_ptr<aura::Window> focus_window(CreateTestWindowInShellWithId(0));
171 ASSERT_NE(nullptr, content->GetNativeView()); 172 ASSERT_NE(nullptr, content->GetNativeView());
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 655
655 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( 656 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation(
656 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); 657 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE);
657 658
658 EXPECT_EQ( 659 EXPECT_EQ(
659 kNewRotation, 660 kNewRotation,
660 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation()); 661 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation());
661 } 662 }
662 663
663 } // namespace ash 664 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/window_cycle_list.cc ('k') | ash/dip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698