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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/VideoRotateToFullscreenTest.java

Issue 2897313002: Android: Simplify isTablet and InterfaceRegistrars (Closed)
Patch Set: Pull out local variable Created 3 years, 6 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 | « no previous file | services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.pm.ActivityInfo; 7 import android.content.pm.ActivityInfo;
8 import android.support.test.filters.MediumTest; 8 import android.support.test.filters.MediumTest;
9 9
10 import org.junit.After; 10 import org.junit.After;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); 86 ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
87 } 87 }
88 }); 88 });
89 } 89 }
90 90
91 @Test 91 @Test
92 @MediumTest 92 @MediumTest
93 @Feature({"VideoRotateToFullscreen"}) 93 @Feature({"VideoRotateToFullscreen"})
94 public void testPortraitToLandscapeAndBack() throws Exception { 94 public void testPortraitToLandscapeAndBack() throws Exception {
95 // TODO(johnme): Use RESTRICTION_TYPE_PHONE once crbug.com/673917 moves it out of chrome/. 95 // TODO(johnme): Use RESTRICTION_TYPE_PHONE once crbug.com/673917 moves it out of chrome/.
96 if (DeviceFormFactor.isTablet(mRule.getActivity())) { 96 if (DeviceFormFactor.isTablet()) {
97 return; 97 return;
98 } 98 }
99 99
100 // Start off in portrait screen orientation. 100 // Start off in portrait screen orientation.
101 mRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTAT ION_PORTRAIT); 101 mRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTAT ION_PORTRAIT);
102 waitForScreenOrientation("\"portrait\""); 102 waitForScreenOrientation("\"portrait\"");
103 103
104 // Start playback. 104 // Start playback.
105 Assert.assertTrue(DOMUtils.isMediaPaused(mRule.getWebContents(), VIDEO_I D)); 105 Assert.assertTrue(DOMUtils.isMediaPaused(mRule.getWebContents(), VIDEO_I D));
106 DOMUtils.playMedia(mRule.getWebContents(), VIDEO_ID); 106 DOMUtils.playMedia(mRule.getWebContents(), VIDEO_ID);
107 DOMUtils.waitForMediaPlay(mRule.getWebContents(), VIDEO_ID); 107 DOMUtils.waitForMediaPlay(mRule.getWebContents(), VIDEO_ID);
108 108
109 // Rotate screen from portrait to landscape. 109 // Rotate screen from portrait to landscape.
110 mRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTAT ION_LANDSCAPE); 110 mRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTAT ION_LANDSCAPE);
111 waitForScreenOrientation("\"landscape\""); 111 waitForScreenOrientation("\"landscape\"");
112 112
113 // Should enter fullscreen. 113 // Should enter fullscreen.
114 waitForContentsFullscreenState(true); 114 waitForContentsFullscreenState(true);
115 115
116 // Rotate screen from landscape to portrait(?). 116 // Rotate screen from landscape to portrait(?).
117 mRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTAT ION_PORTRAIT); 117 mRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTAT ION_PORTRAIT);
118 waitForScreenOrientation("\"portrait\""); 118 waitForScreenOrientation("\"portrait\"");
119 119
120 // Should exit fullscreen. 120 // Should exit fullscreen.
121 waitForContentsFullscreenState(false); 121 waitForContentsFullscreenState(false);
122 } 122 }
123 } 123 }
OLDNEW
« no previous file with comments | « no previous file | services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698