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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java

Issue 2409483002: Read the bare minimum of data from the WebAPK launch intent. (Closed)
Patch Set: Merge branch 'startup_crash0' into security Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
index 22667117ee1500c11b8afc0862ee376a64223d14..b4843642c2a072437f300c8b44995a190ef007b6 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
@@ -211,63 +211,19 @@ public class WebappInfoTest extends InstrumentationTestCase {
@SmallTest
@Feature({"Webapps", "WebApk"})
public void testIntentDisplayMode() {
- {
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(ShortcutHelper.EXTRA_DISPLAY_MODE, WebDisplayMode.MinimalUi);
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(WebDisplayMode.MinimalUi, info.displayMode());
- }
- {
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(WebApkConstants.EXTRA_WEBAPK_DISPLAY_MODE, "fullscreen");
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(WebDisplayMode.Fullscreen, info.displayMode());
- }
- {
- // EXTRA_WEBAPK_DISPLAY_MODE takes precedence over EXTRA_DISPLAY_MODE.
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(WebApkConstants.EXTRA_WEBAPK_DISPLAY_MODE, "fullscreen");
- intent.putExtra(ShortcutHelper.EXTRA_DISPLAY_MODE, WebDisplayMode.MinimalUi);
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(WebDisplayMode.Fullscreen, info.displayMode());
- }
- {
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(WebApkConstants.EXTRA_WEBAPK_DISPLAY_MODE, "invalid");
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(WebDisplayMode.Standalone, info.displayMode());
- }
+ Intent intent = createIntentWithUrlAndId();
+ intent.putExtra(ShortcutHelper.EXTRA_DISPLAY_MODE, WebDisplayMode.MinimalUi);
+ WebappInfo info = WebappInfo.create(intent);
+ assertEquals(WebDisplayMode.MinimalUi, info.displayMode());
}
@SmallTest
@Feature({"Webapps", "WebApk"})
public void testIntentOrientation() {
- {
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(ShortcutHelper.EXTRA_ORIENTATION, ScreenOrientationValues.LANDSCAPE);
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(ScreenOrientationValues.LANDSCAPE, info.orientation());
- }
- {
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(WebApkConstants.EXTRA_WEBAPK_ORIENTATION, "natural");
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(ScreenOrientationValues.NATURAL, info.orientation());
- }
- {
- // EXTRA_WEBAPK_ORIENTATION takes precedence over EXTRA_ORIENTATION.
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(WebApkConstants.EXTRA_WEBAPK_ORIENTATION, "natural");
- intent.putExtra(ShortcutHelper.EXTRA_ORIENTATION, ScreenOrientationValues.LANDSCAPE);
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(ScreenOrientationValues.NATURAL, info.orientation());
- }
- {
- Intent intent = createIntentWithUrlAndId();
- intent.putExtra(WebApkConstants.EXTRA_WEBAPK_ORIENTATION, "invalid");
- WebappInfo info = WebappInfo.create(intent);
- assertEquals(ScreenOrientationValues.DEFAULT, info.orientation());
- }
+ Intent intent = createIntentWithUrlAndId();
+ intent.putExtra(ShortcutHelper.EXTRA_ORIENTATION, ScreenOrientationValues.LANDSCAPE);
+ WebappInfo info = WebappInfo.create(intent);
+ assertEquals(ScreenOrientationValues.LANDSCAPE, info.orientation());
}
@SmallTest

Powered by Google App Engine
This is Rietveld 408576698