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

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

Issue 1220813010: Add UMA metrics to track the source of homescreen icons on launch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comments Created 5 years, 5 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 4afa08c0a86bf456dfe157086f8ee355bf59c6b4..f380a477b0d83598ea4639a3ddd3a6d15c681acd 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
@@ -23,7 +23,8 @@ public class WebappInfoTest extends InstrumentationTestCase {
String title = "webapp title";
String url = "about:blank";
- WebappInfo info = WebappInfo.create(id, url, null, title, ScreenOrientationValues.DEFAULT);
+ WebappInfo info = WebappInfo.create(id, url,
+ null, title, ScreenOrientationValues.DEFAULT, ShortcutHelper.SOURCE_UNKNOWN);
assertNotNull(info);
}
@@ -34,7 +35,8 @@ public class WebappInfoTest extends InstrumentationTestCase {
String title = "webapp title";
String url = "http://google.com";
- WebappInfo info = WebappInfo.create(id, url, null, title, ScreenOrientationValues.DEFAULT);
+ WebappInfo info = WebappInfo.create(id, url,
+ null, title, ScreenOrientationValues.DEFAULT, ShortcutHelper.SOURCE_UNKNOWN);
assertNotNull(info);
}
@@ -53,4 +55,18 @@ public class WebappInfoTest extends InstrumentationTestCase {
WebappInfo info = WebappInfo.create(intent);
assertNotNull(info);
}
+
+ @SmallTest
+ @Feature({"Webapps"})
+ public void testOrientationAndSource() {
+ String id = "webapp id";
+ String title = "webapp title";
+ String url = "http://money.cnn.com";
+
+ WebappInfo info = WebappInfo.create(id, url,
+ null, title, ScreenOrientationValues.DEFAULT, ShortcutHelper.SOURCE_UNKNOWN);
+ assertNotNull(info);
+ assertEquals(info.orientation(), ScreenOrientationValues.DEFAULT);
+ assertEquals(info.source(), ShortcutHelper.SOURCE_UNKNOWN);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698